Skip to content

Android Build and release #9

Android Build and release

Android Build and release #9

Workflow file for this run

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 -arch=*
- 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 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/
- name: Rename APK files
run: |
mv fyne-cross/dist/android/${{ env.APP_NAME }}.apk fyne-cross/dist/android/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
mv fyne-cross/dist/android-386/${{ env.APP_NAME }}.apk fyne-cross/dist/android-386/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
mv fyne-cross/dist/android-amd64/${{ env.APP_NAME }}.apk fyne-cross/dist/android-amd64/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
mv fyne-cross/dist/android-arm/${{ env.APP_NAME }}.apk fyne-cross/dist/android-arm/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
mv fyne-cross/dist/android-arm64/${{ env.APP_NAME }}.apk fyne-cross/dist/android-arm64/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
fyne-cross/dist/android/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
fyne-cross/dist/android-386/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
fyne-cross/dist/android-amd64/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
fyne-cross/dist/android-arm/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
fyne-cross/dist/android-arm64/${{ env.APP_NAME }}_${{ github.ref_name }}.apk
token: ${{ secrets.TOKEN }}