Skip to content

Commit

Permalink
add android zipalign to pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
danielyrovas committed Feb 15, 2024
1 parent 6e78d4e commit b1f7c7a
Showing 1 changed file with 37 additions and 33 deletions.
70 changes: 37 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,42 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Execute Gradle build
run: ./gradlew --no-daemon --build-cache assembleRelease

- name: Sign the APK
run: |
echo "${{ secrets.KEYSTORE }}" > keystore.asc
gpg -d --passphrase "${{ secrets.KEY_PASSWD }}" --batch keystore.asc > keystore.jks
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} -keypass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}
- name: Verify the APK signature
run: jarsigner -verify -verbose -certs -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}

- name: Zipalign the APK
run: ${{ github.workspace }}/cmdline-tools/latest/bin/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
ls /usr/local/lib/android/sdk/build-tools/$BUILD_TOOL_VERSION
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false

- name: Upload release APK
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: app/build/outputs/apk/release/app-release.apk
asset_name: linklater-release.apk
asset_content_type: application/vnd.android.package-archive
# - name: Execute Gradle build
# run: ./gradlew --no-daemon --build-cache assembleRelease
#
# - name: Sign the APK
# run: |
# echo "${{ secrets.KEYSTORE }}" > keystore.asc
# gpg -d --passphrase "${{ secrets.KEY_PASSWD }}" --batch keystore.asc > keystore.jks
# jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} -keypass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}
#
# - name: Verify the APK signature
# run: jarsigner -verify -verbose -certs -keystore keystore.jks -storepass ${{ secrets.KEY_PASSWD }} app/build/outputs/apk/release/app-release-unsigned.apk ${{ secrets.KEY_ALIAS }}
#
# - name: Zipalign the APK
# run: ${{ github.workspace }}/cmdline-tools/latest/bin/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk
#
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.RELEASE_VERSION }}
# release_name: Release ${{ env.RELEASE_VERSION }}
# draft: false
# prerelease: false
#
# - name: Upload release APK
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: app/build/outputs/apk/release/app-release.apk
# asset_name: linklater-release.apk
# asset_content_type: application/vnd.android.package-archive

0 comments on commit b1f7c7a

Please sign in to comment.