Skip to content

Commit

Permalink
ci: move apk build to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranroneill committed Oct 16, 2024
1 parent a6fe285 commit 77866da
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 33 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@ on:
environment:
required: true
type: string
release_upload_url:
required: true
type: string
secrets:
APK_SIGNING_KEY_ALIAS:
required: true
APK_SIGNING_KEY_PASSWORD:
required: true
APK_SIGNING_KEYSTORE:
required: true
APK_SIGNING_KEYSTORE_PASSWORD:
required: true
PLAY_STORE_UPLOAD_KEY_ALIAS:
required: true
PLAY_STORE_UPLOAD_KEY_PASSWORD:
Expand All @@ -19,6 +30,32 @@ on:
required: true

jobs:
publish_android_apk:
name: "Publish Android APK"
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "📱 Setup Flutter"
uses: ./.github/actions/use-flutter-dependencies
- name: "🔑 Create Android Signing Keys"
env:
ANDROID_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
ANDROID_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
run: ./scripts/create_android_signing_keys.sh
- name: "🏗️ Build Android APK"
run: flutter build apk --release
- name: "📤 Upload Release Asset"
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ inputs.release_upload_url }}
asset_path: build/app/outputs/flutter-apk/release/app-release.apk
asset_name: kibisis_release.apk
asset_content_type: application/vnd.android.package-archive

publish_to_play_store:
name: "Publish To The Play Store"
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ jobs:
uses: ./.github/workflows/publish.yml
with:
environment: "beta"
release_upload_url: ${{ github.event.release.upload_url }}
secrets:
APK_SIGNING_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
APK_SIGNING_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
APK_SIGNING_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
APK_SIGNING_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
PLAY_STORE_UPLOAD_KEY_ALIAS: ${{ secrets.PLAY_STORE_UPLOAD_KEY_ALIAS }}
PLAY_STORE_UPLOAD_KEY_PASSWORD: ${{ secrets.PLAY_STORE_UPLOAD_KEY_PASSWORD }}
PLAY_STORE_UPLOAD_KEYSTORE: ${{ secrets.PLAY_STORE_UPLOAD_KEYSTORE }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/publish_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ jobs:
uses: ./.github/workflows/publish.yml
with:
environment: "production"
release_upload_url: ${{ github.event.release.upload_url }}
secrets:
APK_SIGNING_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
APK_SIGNING_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
APK_SIGNING_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
APK_SIGNING_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
PLAY_STORE_UPLOAD_KEY_ALIAS: ${{ secrets.PLAY_STORE_UPLOAD_KEY_ALIAS }}
PLAY_STORE_UPLOAD_KEY_PASSWORD: ${{ secrets.PLAY_STORE_UPLOAD_KEY_PASSWORD }}
PLAY_STORE_UPLOAD_KEYSTORE: ${{ secrets.PLAY_STORE_UPLOAD_KEYSTORE }}
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ on:
required: true
type: string
secrets:
APK_SIGNING_KEY_ALIAS:
required: true
APK_SIGNING_KEY_PASSWORD:
required: true
APK_SIGNING_KEYSTORE:
required: true
APK_SIGNING_KEYSTORE_PASSWORD:
required: true
READ_AND_WRITE_REPOS_TOKEN:
required: true

Expand All @@ -30,19 +22,8 @@ jobs:
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "📱 Setup Flutter"
uses: ./.github/actions/use-flutter-dependencies
- name: "📦 Install yq"
uses: ./.github/actions/install-yq # needed to update pubspec.yaml via a shell command
- name: "🔑 Create Android Signing Keys"
env:
ANDROID_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
ANDROID_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
run: ./scripts/create_android_signing_keys.sh
- name: "🏗️ Build Android APK"
run: flutter build apk --release
- name: "🔧 Setup Node"
uses: actions/setup-node@v4
with:
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/release_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- beta

permissions:
contents: write
issues: write
pull-requests: write
contents: write # to be able to publish a github release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

jobs:
deploy:
Expand All @@ -17,8 +17,4 @@ jobs:
with:
environment: "beta"
secrets:
APK_SIGNING_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
APK_SIGNING_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
APK_SIGNING_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
APK_SIGNING_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
READ_AND_WRITE_REPOS_TOKEN: ${{ secrets.READ_AND_WRITE_REPOS_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ on:
branches:
- main

permissions:
contents: write # to be able to publish a github release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

jobs:
deploy:
name: "🔖 Release"
uses: ./.github/workflows/release.yml
with:
environment: "production"
secrets:
APK_SIGNING_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
APK_SIGNING_KEY_PASSWORD: ${{ secrets.APK_SIGNING_KEY_PASSWORD }}
APK_SIGNING_KEYSTORE: ${{ secrets.APK_SIGNING_KEYSTORE }}
APK_SIGNING_KEYSTORE_PASSWORD: ${{ secrets.APK_SIGNING_KEYSTORE_PASSWORD }}
READ_AND_WRITE_REPOS_TOKEN: ${{ secrets.READ_AND_WRITE_REPOS_TOKEN }}
3 changes: 0 additions & 3 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
[
"@semantic-release/github",
{
"assets": [
{ "label": "kibisis_release.apk" ,"path": "build/app/outputs/flutter-apk/release/app-release.apk" }
],
"releasedLabels": ["🚀 released"]
}
]
Expand Down

0 comments on commit 77866da

Please sign in to comment.