adding automatic foss apk uploading to the release

This commit is contained in:
Adam Brown 2022-09-29 19:29:33 +01:00
parent 6df204009e
commit 40222b5ea3
4 changed files with 17 additions and 3 deletions

View File

@ -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:
@ -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)

View File

@ -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,
@ -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)

View File

@ -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

View File

@ -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