new version of build uses slightly different options compared to olde… #85
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
cd cmd/tasks/ | |
fyne-cross windows -arch=* -ldflags -H=windowsgui -app-id 'com.networkrehab' | |
- name: Build for Linux | |
run: fyne-cross linux -arch=* | |
- 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 | |