Skip to content

Commit

Permalink
adding automatic foss apk uploading to the release
Browse files Browse the repository at this point in the history
  • Loading branch information
ouchadam committed Sep 29, 2022
1 parent 6df2040 commit 40222b5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ jobs:
touch .secrets/service-account.json
touch .secrets/matrix.json
echo -n '${{ secrets.UPLOAD_KEY }}' | base64 --decode >> .secrets/upload-key.jks
echo -n '${{ secrets.FDROID_KEY }}' | base64 --decode >> .secrets/fdroid.keystore
echo -n '${{ secrets.SERVICE_ACCOUNT }}' | base64 --decode >> .secrets/service-account.json
echo -n '${{ secrets.MATRIX }}' | base64 --decode >> .secrets/matrix.json
- name: Assemble release variant
run: ./tools/generate-release.sh ${{ secrets.STORE_PASS }}
run: |
./tools/generate-release.sh ${{ secrets.STORE_PASS }}
./tools/generate-fdroid-release.sh ${{ secrets.FDROID_STORE_PASS }}
- uses: actions/github-script@v6
with:
Expand All @@ -48,6 +51,7 @@ jobs:
const artifacts = {
bundle: '${{ github.workspace }}/app/build/outputs/bundle/release/app-release.aab',
mapping: '${{ github.workspace }}/app/build/outputs/mapping/release/mapping.txt',
fossApkPath: '${{ github.workspace }}/app/build/outputs/apk/release/app-foss-release-signed.apk',
}
await publishRelease(github, artifacts)
10 changes: 10 additions & 0 deletions tools/beta-release/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const release = async (github, version, applicationId, artifacts, config)

console.log(releaseResult.data.id)

console.log("Uploading universal apk...")
await github.rest.repos.uploadReleaseAsset({
owner: config.owner,
repo: config.repo,
Expand All @@ -64,6 +65,15 @@ export const release = async (github, version, applicationId, artifacts, config)
data: fs.readFileSync(universalApkPath)
})

console.log("Uploading foss apk...")
await github.rest.repos.uploadReleaseAsset({
owner: config.owner,
repo: config.repo,
release_id: releaseResult.data.id,
name: `foss-signed-${version.name}.apk`,
data: fs.readFileSync(artifacts.fossApkPath)
})

console.log("Promoting beta draft release to live...")
await promoteDraftToLive(applicationId)

Expand Down
2 changes: 1 addition & 1 deletion tools/generate-fdroid-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SIGNED=$WORKING_DIR/app-foss-release-signed.apk
ZIPALIGN=$(find "$ANDROID_HOME" -iname zipalign -print -quit)
APKSIGNER=$(find "$ANDROID_HOME" -iname apksigner -print -quit)

./gradlew clean assembleRelease -Pfoss -Punsigned --no-daemon --no-configuration-cache --no-build-cache
./gradlew assembleRelease -Pfoss -Punsigned --no-daemon --no-configuration-cache --no-build-cache

$ZIPALIGN -v -p 4 $UNSIGNED $ALIGNED_UNSIGNED

Expand Down
2 changes: 1 addition & 1 deletion tools/generate-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

./gradlew clean bundleRelease -Punsigned --no-daemon --no-configuration-cache --no-build-cache
./gradlew bundleRelease -Punsigned --no-daemon --no-configuration-cache --no-build-cache

WORKING_DIR=app/build/outputs/bundle/release
RELEASE_AAB=$WORKING_DIR/app-release.aab
Expand Down

0 comments on commit 40222b5

Please sign in to comment.