7.2.3 #20
Workflow file for this run
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
name: Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Keystore | |
run: | | |
echo "${{ secrets.KEYSTORE }}" > release.b64 | |
base64 -d release.b64 > release.keystore | |
- name: Create Version Code | |
id: version_code | |
run: | | |
git checkout master | |
echo "value=$(git rev-list --count HEAD)" >>$GITHUB_OUTPUT | |
echo "VERSION_CODE $(git rev-list --count HEAD)" | |
- name: Build Application | |
run: | | |
./gradlew clean assembleRelease \ | |
-PKEYSTORE=../release.keystore \ | |
-PKEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ | |
-PKEY_ALIAS=${{ secrets.KEY_ALIAS }} \ | |
-PKEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \ | |
-PRELEASE_MAPS_API_KEY=${{ secrets.MAPS_API_KEY }} \ | |
-PVERSION_CODE=${{ steps.version_code.outputs.value }} | |
- name: Get Upload URL | |
id: url | |
run: | | |
url="https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${GITHUB_REF#refs/tags/}" | |
echo "upload_url=$(curl -sL $url | jq -r '.upload_url')" >>$GITHUB_OUTPUT | |
- name: Upload Artifacts | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.url.outputs.upload_url }} | |
asset_path: mage/build/outputs/apk/release/mage-release.apk | |
asset_name: mage-release.apk | |
asset_content_type: application/octet-stream |