Skip to content

Split build jobs to use different runners and avoid fyne-cross #41

Split build jobs to use different runners and avoid fyne-cross

Split build jobs to use different runners and avoid fyne-cross #41

Workflow file for this run

name: Build
on:
push:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.set-date.outputs.date }}
sha_short: ${{ steps.set-sha.outputs.sha_short }}
steps:
- uses: actions/checkout@v3
- name: Current date
id: set-date
run: echo "::set-output name=date::$(date +%F)"
- name: Git commit short SHA
id: set-sha
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
build-windows:
runs-on: windows-latest
needs: setup
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Install Fyne CLI
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Build for Windows
run: fyne package -os windows -id com.leanercloud.savings-estimator -icon Icon.png
- name: Attach Windows Artifact to Release
uses: svenstaro/upload-release-action@v2
with:
tag: 1.0-${{ needs.setup.outputs.date }}-git-${{ needs.setup.outputs.sha_short }}
file: savings-estimator.exe
asset_name: savings-estimator-windows-amd64.exe
build-linux:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Install Fyne CLI
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Build for Linux
run: fyne package -os linux -icon Icon.png
- name: Attach Linux Artifact to Release
uses: svenstaro/upload-release-action@v2
with:
tag: 1.0-${{ needs.setup.outputs.date }}-git-${{ needs.setup.outputs.sha_short }}
file: savings-estimator
asset_name: savings-estimator-linux-amd64
build-macos:
runs-on: macos-latest
needs: setup
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Install Fyne CLI
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Build for macOS
run: fyne package -os darwin -app-id com.leanercloud.savings-estimator -icon Icon.png
- name: Attach macOS Artifact to Release
uses: svenstaro/upload-release-action@v2
with:
tag: 1.0-${{ needs.setup.outputs.date }}-git-${{ needs.setup.outputs.sha_short }}
file: savings-estimator.app
asset_name: savings-estimator-macos.app