Android Build and release #2
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: Android Build and release | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: Build | |
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 Android | |
run: | | |
fyne-cross android | |
- name: Read TOML and set env vars | |
run: | | |
APP_NAME=$(awk -F '=' '/Name/ {gsub(/"/, "", $2); print $2}' fyne-cross.toml | xargs) | |
echo "APP_NAME=$APP_NAME" >> $GITHUB_ENV | |
- name: Upload Android APKs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: android | |
path: | | |
fyne-cross/dist/android/ | |
fyne-cross/dist/android-386/ | |
fyne-cross/dist/android-amd64/ | |
fyne-cross/dist/android-arm/ | |
fyne-cross/dist/android-arm64/ | |
create-release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Android 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: ./android/android/${{ env.APP_NAME }}.apk | |
asset_name: ${{ env.APP_NAME }}-android-all.apk | |
asset_content_type: application/vnd.android.package-archive |