Skip to content

Refactor database management and implement custom widget; update buil… #78

Refactor database management and implement custom widget; update buil…

Refactor database management and implement custom widget; update buil… #78

Workflow file for this run

name: Build and Release
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.2'
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libgl1-mesa-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxxf86vm-dev
go install github.com/fyne-io/fyne-cross@latest
- name: Build for Windows
run: fyne-cross windows -app-id com.networkrehab.gotasks -arch=amd64 -ldflags -H=windowsgui ./cmd/tasks
- name: Build for Linux
run: fyne-cross linux -app-id com.networkrehab.gotasks -arch=amd64 ./cmd/tasks
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: go_tasks_builds
path: |
fyne-cross/dist/*/
!fyne-cross/dist/*/deps/
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./binaries
- name: Extract version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
else
echo "VERSION=v1.1.${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.VERSION }}
release_name: Release ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false
- name: Zip Binaries
run: |
cd binaries
zip -r ../go_tasks.zip ./*
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./go_tasks.zip
asset_name: go_tasks.zip
asset_content_type: application/zip