Fix build for windows and add macOS builds #40
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.22" | |
- name: Install fyne-cross | |
run: go install github.com/fyne-io/fyne-cross@latest | |
- name: Build for Windows | |
run: fyne-cross windows -arch=amd64 -app-id com.leanercloud.savings-estimator | |
- name: Build for Linux | |
run: fyne-cross linux -arch=amd64,arm64 | |
- name: Build for macOS | |
run: fyne-cross darwin -arch=amd64,arm64 -app-id com.leanercloud.savings-estimator | |
- name: Current date | |
id: date | |
run: echo "date=$(date +%F)" >> $GITHUB_ENV | |
- name: Git commit short SHA | |
id: sha_short | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
- name: Attach Windows Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: 1.0-${{ env.date }}-git-${{ env.sha_short }} | |
file: fyne-cross/bin/windows-amd64/savings-estimator.exe | |
asset_name: savings-estimator-windows-amd64.exe | |
- name: Attach Linux Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: 1.0-${{ env.date }}-git-${{ env.sha_short }} | |
file: fyne-cross/bin/linux-amd64/savings-estimator | |
asset_name: savings-estimator-linux-amd64 | |
- name: Attach Linux ARM64 Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: 1.0-${{ env.date }}-git-${{ env.sha_short }} | |
file: fyne-cross/bin/linux-arm64/savings-estimator | |
asset_name: savings-estimator-linux-arm64 | |
- name: Attach macOS AMD64 Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: 1.0-${{ env.date }}-git-${{ env.sha_short }} | |
file: fyne-cross/bin/darwin-amd64/savings-estimator.app | |
asset_name: savings-estimator-macos-amd64.app | |
- name: Attach macOS ARM64 Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: 1.0-${{ env.date }}-git-${{ env.sha_short }} | |
file: fyne-cross/bin/darwin-arm64/savings-estimator.app | |
asset_name: savings-estimator-macos-arm64.app |