Skip to content

Commit

Permalink
Refactor workflow files for Android, Linux, and Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjay7178 committed Aug 22, 2024
1 parent 6cdb7a1 commit 8779240
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 42 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Fyne Cross
run: go install github.com/fyne-io/fyne-cross@latest

- name: Build for Android
- name: Build for Android
run: |
fyne-cross android
Expand All @@ -30,7 +30,6 @@ jobs:
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:
Expand All @@ -42,31 +41,17 @@ jobs:
fyne-cross/dist/android-arm/
fyne-cross/dist/android-arm64/
create-release:
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.TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false


- name: Upload signed apk
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/vtop_ap_${{ github.ref_name }}.apk
asset_name: vtop_ap_${{ github.ref_name }}.apk
asset_content_type: application/vnd.android.package-archive
files: |
android/android/${{ env.APP_NAME }}.apk
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 13 additions & 11 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Linux Build and Release
name: Multi-Platform Build

on:
release:
Expand All @@ -21,9 +21,14 @@ jobs:
- name: Set up Fyne Cross
run: go install github.com/fyne-io/fyne-cross@latest

- name: Build for linux
- name: Build for Windows, Linux, macOS, and Android
run: |
fyne-cross linux
- 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 Linux Artifact
uses: actions/upload-artifact@v2
Expand All @@ -43,19 +48,16 @@ jobs:
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux/tmp.tar.xz
asset_name: linux-amd64.tar.xz
asset_content_type: application/x-xz
files: |
linux/${{ env.APP_NAME }}.tar.xz
13 changes: 5 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
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
files: |
./${{ env.APP_NAME }}-windows-amd64.exe

0 comments on commit 8779240

Please sign in to comment.