-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
89 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 |
---|---|---|
|
@@ -28,6 +28,10 @@ jobs: | |
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Install Bundletool | ||
run: | | ||
wget https://github.com/google/bundletool/releases/download/1.17.0/bundletool-all-1.17.0.jar -O /usr/local/bin/bundletool.jar | ||
- name: Decode Keystore | ||
env: | ||
ENCODED_KEYSTORE: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }} | ||
|
@@ -49,52 +53,21 @@ jobs: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | ||
run: ./gradlew :app:bundleRelease | ||
|
||
- name: Debug path issues | ||
run: find . | ||
|
||
- name: Convert AAB to APK | ||
uses: mukeshsolanki/[email protected] | ||
with: | ||
aabFile: android/app/build/outputs/bundle/release/app-release.aab | ||
base64Keystore: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }} | ||
keystoreAlias: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | ||
keyPassword: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | ||
keystorePassword: ${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }} | ||
bundletoolVersion: '1.9.0' | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: release-apk | ||
path: ${{ steps.convert_aab.outputs.apkPath }} | ||
|
||
# All the below should only run if we are doing a release. | ||
|
||
- name: Add APK to GitHub release | ||
uses: softprops/action-gh-release@v2 | ||
if: ${{ startsWith(github.event.release.tag_name, 'android-') }} | ||
with: | ||
name: ${{ github.ref_name }} | ||
fail_on_unmatched_files: true | ||
# see https://github.com/softprops/action-gh-release/issues/158 | ||
files: | | ||
${{ steps.convert_aab.outputs.apkPath }} | ||
run: | | ||
java -jar /usr/local/bin/bundletool.jar build-apks \ | ||
--mode=universal \ | ||
--bundle=./app/build/outputs/bundle/release/app-release.aab \ | ||
--output=./app/build/outputs/bundle/release/app-release.apks \ | ||
--ks=./app/$DECODED_KEYSTORE_PATH \ | ||
--ks-pass=pass:${{ secrets.ANDROID_RELEASE_STORE_PASSWORD }} \ | ||
--ks-key-alias=${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} \ | ||
--key-pass=${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | ||
cd ${{ github.workspace }} && unzip ./app/build/outputs/bundle/release/app-release.apks | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
if: ${{ startsWith(github.event.release.tag_name, 'android-') }} | ||
- name: Upload .apk | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-1 | ||
|
||
- name: Extract version from tag | ||
if: ${{ startsWith(github.event.release.tag_name, 'android-') }} | ||
run: echo "VERSION_NAME=$(echo ${{ github.event.release.tag_name }} | sed 's/android-//')" >> $GITHUB_ENV | ||
|
||
- name: Upload AAB to S3 | ||
if: ${{ startsWith(github.event.release.tag_name, 'android-') }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
run: | | ||
aws s3 cp app/build/outputs/bundle/release/app-release.aab s3://hn-artifacts/app-release-${{ env.VERSION_NAME }}.aab | ||
path: ${{ github.workspace }}/universal.apk | ||
name: hackernews-universal-${{github.sha}}.apk | ||
if-no-files-found: error |
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
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