-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
bf3406d
commit 8838447
Showing
2 changed files
with
65 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build dev test build | ||
permissions: write-all | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
APP_VERSION=$(grep 'app-versionName' gradle/libs.versions.toml | sed 's/.*= "\(.*\)"/\1/') | ||
echo "RELEASE_VERSION=$APP_VERSION" >> $GITHUB_ENV | ||
- name: Set up JDK env | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 19 | ||
cache: 'gradle' | ||
|
||
- name: Execute Gradle build | ||
run: ./gradlew --no-daemon --build-cache assembleRelease | ||
|
||
- name: Get build tools | ||
run: | | ||
BUILD_TOOLS_PATH=/usr/local/lib/android/sdk/build-tools/$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | ||
echo "BUILD_TOOLS=$BUILD_TOOLS_PATH" >> $GITHUB_ENV | ||
- name: Zipalign the APK | ||
run: | | ||
$BUILD_TOOLS/zipalign -v 4 app/build/outputs/apk/release/app-release-unsigned.apk app-release-unsigned.apk | ||
- name: Sign the APK | ||
run: | | ||
echo "${{ secrets.KEYSTORE }}" > keystore.asc | ||
gpg -d --passphrase "${{ secrets.KEY_PASSWD }}" --batch keystore.asc > keystore.jks | ||
$BUILD_TOOLS/apksigner sign --ks keystore.jks --ks-key-alias ${{ secrets.KEY_ALIAS }} --ks-pass pass:${{ secrets.KEY_PASSWD }} --key-pass pass:${{ secrets.KEY_PASSWD }} --out app-release.apk app-release-unsigned.apk | ||
- name: Verify the APK signature | ||
run: $BUILD_TOOLS/apksigner verify 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: true | ||
|
||
- 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-release.apk | ||
asset_name: linklater-release.apk | ||
asset_content_type: application/vnd.android.package-archive | ||
|
||
|
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