Skip to content

Instantly share code, notes, and snippets.

@iqan
Created May 9, 2020 19:06
Show Gist options
  • Save iqan/63b1a3d498c7bbe9bfa09233cd904968 to your computer and use it in GitHub Desktop.
Save iqan/63b1a3d498c7bbe9bfa09233cd904968 to your computer and use it in GitHub Desktop.
name: Demo App Android Release
on:
push:
branches: [ master ]
jobs:
version:
name: Create version number
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --depth=10000
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.2.x'
- name: Use GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Create version.txt with nuGetVersion
run: echo ${{ steps.gitversion.outputs.nuGetVersion }} > version.txt
- name: Upload version.txt
uses: actions/upload-artifact@v2
with:
name: gitversion
path: version.txt
build:
name: Build APK and Create release
needs: [ version ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'
- uses: subosito/flutter-action@v1
with:
flutter-version: '1.17.0'
- name: Get version.txt
uses: actions/download-artifact@v2
with:
name: gitversion
- name: Read version
id: version
uses: juliangruber/read-file-action@v1
with:
path: version.txt
- run: flutter pub get
- run: flutter test
- run: flutter build apk --release --split-per-abi
- run: flutter build appbundle
- name: Create a Release in GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/apk/release/*.apk,build/app/outputs/bundle/release/app-release.aab"
token: ${{ secrets.GH_TOKEN }}
tag: ${{ steps.version.outputs.content }}
commit: ${{ github.sha }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment