Skip to content

Commit

Permalink
Split build/release triggering
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-matt-hillsdon committed Apr 8, 2024
1 parent 6d0cd7a commit cf5fbc6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 31 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: build
on:
release:
types: [created]
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name != 'release'
permissions:
contents: read
steps:
Expand All @@ -23,31 +20,3 @@ jobs:
name: build
path: ./app/build/outputs/apk/debug/*.apk
retention-days: 3
release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- run: echo "SIGNING_STORE_FILE=$RUNNER_TEMP/keystore.jks" >> $GITHUB_ENV
- run: printenv SIGNING_STORE_FILE_BASE64 | base64 -d > "$SIGNING_STORE_FILE"
env:
SIGNING_STORE_FILE_BASE64: ${{ secrets.ANDROID_SIGNING_STORE_FILE_BASE64 }}
- run: ./gradlew --no-daemon :app:assembleRelease :app:bundleRelease
env:
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_KEY_ALIAS: upload
- run: rm "$SIGNING_STORE_FILE"
- uses: microbit-foundation/[email protected]
with:
file: app/build/outputs/apk/bundle/app-bundle.aab
asset_name: microbit-bundle-${{ env.TAG }}.aab
- uses: microbit-foundation/[email protected]
with:
file: app/build/outputs/apk/release/app-release.apk
asset_name: microbit-release-${{ env.TAG }}.apk
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build
on:
release:
types: [created]

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- run: echo "SIGNING_STORE_FILE=$RUNNER_TEMP/keystore.jks" >> $GITHUB_ENV
- run: printenv SIGNING_STORE_FILE_BASE64 | base64 -d > "$SIGNING_STORE_FILE"
env:
SIGNING_STORE_FILE_BASE64: ${{ secrets.ANDROID_SIGNING_STORE_FILE_BASE64 }}
- run: ./gradlew --no-daemon :app:assembleRelease :app:bundleRelease
env:
SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
SIGNING_KEY_ALIAS: upload
- run: rm "$SIGNING_STORE_FILE"
- uses: microbit-foundation/[email protected]
with:
file: app/build/outputs/apk/bundle/app-bundle.aab
asset_name: microbit-bundle-${{ env.TAG }}.aab
- uses: microbit-foundation/[email protected]
with:
file: app/build/outputs/apk/release/app-release.apk
asset_name: microbit-release-${{ env.TAG }}.apk

0 comments on commit cf5fbc6

Please sign in to comment.