-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d217c6
commit 0fb123f
Showing
2 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: Android Release | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
version: | ||
name: Create version number | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: "5.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: Create Android Build | ||
needs: version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get version.txt | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: gitversion | ||
- name: Create new file without newline char from version.txt | ||
run: tr -d '\n' < version.txt > version1.txt | ||
- name: Read version | ||
id: version | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: version1.txt | ||
- name: Update version in YAML | ||
run: sed -i 's/99.99.99+99/${{ steps.version.outputs.content }}+${{ github.run_number }}/g' pubspec.yaml | ||
- name: Download Android keystore | ||
id: android_keystore | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: sn-upload-keystore.jks | ||
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | ||
- name: Create key.properties | ||
run: | | ||
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties | ||
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties | ||
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties | ||
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: "12.x" | ||
cache: gradle | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: "3.0.0" | ||
channel: 'stable' | ||
cache: true | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Start Android Release Build | ||
run: flutter build appbundle | ||
|
||
- name: Upload Android Release | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: android-release | ||
path: build/app/outputs/bundle/release/app-release.aab | ||
|
||
deploy: | ||
name: Deploy Android Build | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Get Android Build from artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: android-release | ||
- name: Release Build to internal track | ||
uses: r0adkll/upload-google-play@v1 | ||
with: | ||
serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }} | ||
packageName: news.stacker.app | ||
releaseFiles: app-release.aab | ||
track: production | ||
status: completed |
File renamed without changes.