Windows Build and Release #3
Workflow file for this run
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: Windows Build and Release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build-windows: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22' | |
- name: Set up Fyne Cross | |
run: go install github.com/fyne-io/fyne-cross@latest | |
- name: Build for Windows | |
run: fyne-cross windows | |
- name: Read TOML and set env vars | |
run: | | |
APP_NAME=$(awk -F '=' '/Name/ {gsub(/"/, "", $2); print $2}' FyneApp.toml | xargs) | |
echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV | |
- name: Upload Windows Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: windows | |
path: fyne-cross/dist/windows-amd64/ | |
create-windows-release: | |
needs: build-windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Windows artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: windows | |
- name: Get release | |
id: get_release | |
uses: bruceadams/get-release@v1.2.3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
- name: Upload Windows Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./${{ env.APP_NAME }}.exe | |
asset_name: ${{ env.APP_NAME }}-windows-amd64.exe | |
asset_content_type: application/vnd.microsoft.portable-executable |