-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from arafaysaleem/ci/fix-release-workflow
Add code signing
- Loading branch information
Showing
4 changed files
with
114 additions
and
46 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 |
---|---|---|
|
@@ -9,48 +9,99 @@ on: | |
|
||
name: Build Release APK | ||
jobs: | ||
build: | ||
flutter-setup: | ||
if: github.event.pull_request.merged == true | ||
name: build-release | ||
name: Run Codegen and analyze | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '12.x' | ||
- name: Checkout Flutter Stable Channel | ||
uses: subosito/[email protected] | ||
with: | ||
channel: 'stable' | ||
- name: Get Pub Dependencies | ||
run: flutter pub get | ||
- name: Run build runner for codegen files | ||
run: flutter packages pub run build_runner build --delete-conflicting-outputs | ||
- name: Run Dart Analyzer | ||
run: flutter analyze . | ||
- name: Generate splitted release apks | ||
run: flutter build apk --target-platform android-arm,android-arm64 --split-per-abi --obfuscate --split-debug-info=./ez_tickets_app/debug_trace | ||
- name: Bump version and push tag | ||
id: generate_tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: minor # major, minor, patch, false | ||
custom_release_rules: "ci:patch:CI/CD,chore:patch:Chore Tasks,hotfix:minor:Bug Fixes,refact:patch:Refactors,docs:patch:Documentation Changes,build:patch:Build System/Dependency Upgrades" | ||
- name: Upload release apk to artifacts | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: "${{ steps.generate_tag.outputs.new_tag }}" | ||
artifacts: "build/app/outputs/flutter-apk/*.apk" | ||
name: "Release ${{ steps.generate_tag.outputs.new_tag }}" | ||
body: "${{ steps.generate_tag.outputs.changelog }}" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Upload apks to google drive | ||
uses: mkrakowitzer/actions-googledrive@1 | ||
with: | ||
upload-from: ./build/app/outputs/apk/release/ | ||
upload-to: APKS/ez_tickets_app/ | ||
skicka-tokencache-json: ${{ secrets.SKICKA_TOKENCACHE_JSON }} | ||
google-client-id: ${{ secrets.DRIVE_CLIENT_ID }} | ||
google-client-secret: ${{ secrets.DRIVE_CLIENT_SECRET }} | ||
remove-outdated: 'false' | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '12.x' | ||
- name: Checkout Flutter Stable Channel | ||
uses: subosito/[email protected] | ||
with: | ||
channel: 'stable' | ||
- name: Get Pub Dependencies | ||
run: flutter pub get | ||
- name: Run build runner for codegen files | ||
run: flutter packages pub run build_runner build --delete-conflicting-outputs | ||
- name: Run Dart Analyzer | ||
run: flutter analyze . | ||
|
||
assemble-release: | ||
name: Setup signing keys | ||
runs-on: ubuntu-latest | ||
env: | ||
ENCRYPTED_KEYSTORE: ${{ secrets.ENCRYPTED_KEYSTORE }} | ||
KEYSTORE_FILENAME: ${{ secrets.KEYSTORE_FILENAME }} | ||
KEYSTORE_PASSPHRASE: ${{ secrets.KEYSTORE_PASSPHRASE }} | ||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Load and decrypt keystore #destination of both should be the android folder | ||
run: | | ||
echo "$ENCRYPTED_KEYSTORE" > "$KEYSTORE_FILENAME.asc" | ||
gpg -d --passphrase "$KEYSTORE_PASSPHRASE" --batch "$KEYSTORE_FILENAME.asc" > "./android/$KEYSTORE_FILENAME" | ||
- name: Generate key properties | ||
run: | | ||
echo "storeFile=$KEYSTORE_FILENAME" > ./android/key.properties | ||
echo "storePassword=$KEYSTORE_PASSPHRASE" > ./android/key.properties | ||
echo "keyPassword=$KEYSTORE_PASSPHRASE" > ./android/key.properties | ||
echo "keyAlias=$KEY_ALIAS" > ./android/key.properties | ||
build-release: | ||
needs: [flutter-setup,assemble-release] | ||
name: Build Release APKS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '12.x' | ||
- name: Checkout Flutter Stable Channel | ||
uses: subosito/[email protected] | ||
with: | ||
channel: 'stable' | ||
- name: Get Pub Dependencies | ||
run: flutter pub get | ||
- name: Run build runner for codegen files | ||
run: flutter packages pub run build_runner build --delete-conflicting-outputs | ||
- name: Generate splitted release apks | ||
run: flutter build apk --target-platform android-arm,android-arm64 --split-per-abi --obfuscate --split-debug-info=./ez_tickets_app/debug_trace | ||
|
||
release-artifacts-upload: | ||
needs: [build-release] | ||
name: Upload APKS to release artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Bump version and push tag | ||
id: generate_tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: minor # major, minor, patch, false | ||
custom_release_rules: "ci:patch:CI/CD,chore:patch:Chore Tasks,hotfix:minor:Bug Fixes,refact:patch:Refactors,docs:patch:Documentation Changes,build:patch:Build System/Dependency Upgrades" | ||
- name: Upload release apk to artifacts | ||
uses: ncipollo/[email protected] | ||
with: | ||
tag: "${{ steps.generate_tag.outputs.new_tag }}" | ||
artifacts: "build/app/outputs/flutter-apk/*.apk" | ||
name: "Release ${{ steps.generate_tag.outputs.new_tag }}" | ||
body: "${{ steps.generate_tag.outputs.changelog }}" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
google-drive-upload: | ||
needs: [build-release] | ||
name: Upload APKS to google drive | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Upload apks to google drive | ||
uses: mkrakowitzer/actions-googledrive@1 | ||
with: | ||
upload-from: ./build/app/outputs/flutter-apk/ | ||
upload-to: APKS/ez_tickets_app/ | ||
skicka-tokencache-json: ${{ secrets.SKICKA_TOKENCACHE_JSON }} | ||
google-client-id: ${{ secrets.DRIVE_CLIENT_ID }} | ||
google-client-secret: ${{ secrets.DRIVE_CLIENT_SECRET }} | ||
remove-outdated: 'false' |
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
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 |
---|---|---|
|
@@ -49,3 +49,6 @@ app.*.map.json | |
*.g.dart | ||
*.freezed.dart | ||
*.gr.dart | ||
|
||
#keystore | ||
*.jks |
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