Provide instructions for allowing the app to run on macOS #47
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: | |
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 logo.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: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgl1-mesa-dev \ | |
libx11-dev \ | |
libxcursor-dev \ | |
libxrandr-dev \ | |
libxi-dev \ | |
libxxf86vm-dev \ | |
libfreetype6-dev \ | |
libxinerama-dev \ | |
libglfw3 \ | |
libglfw3-dev \ | |
pkg-config | |
- name: Build for Linux | |
run: fyne package -os linux -icon logo.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.tar.xz | |
asset_name: savings-estimator-linux-amd64.tar.xz | |
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 -id com.leanercloud.savings-estimator -icon logo.png | |
- name: Compress macOS .app Bundle | |
run: zip -r savings-estimator-macos.zip savings-estimator.app | |
- 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-macos.zip | |
asset_name: savings-estimator-macos-arm64.zip |