Skip to content

Attach files to the release #6

Attach files to the release

Attach files to the release #6

Workflow file for this run

name: GitHub Release with APKs
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Write sign info
run: |
if [ ! -z "${{ secrets.KEYSTORE }}" ]; then
echo releaseStorePassword='${{ secrets.SIGNING_STORE_PASSWORD }}' >> gradle.properties
echo releaseKeyAlias='${{ secrets.SIGNING_KEY_ALIAS }}' >> gradle.properties
echo releaseKeyPassword='${{ secrets.SIGNING_KEY_PASSWORD }}' >> gradle.properties
echo releaseStoreFile='${{ github.workspace }}/key.jks' >> gradle.properties
echo ${{ secrets.KEYSTORE }} | base64 --decode > ${{ github.workspace }}/key.jks
fi
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.5.1
- name: Accept Android licenses
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Build app
run: ./gradlew :app-compose:assembleRelease :app-compose:bundleRelease
- name: Upload built Foss apk
if: success()
uses: actions/upload-artifact@v3
with:
name: app-compose-foss-release.apk
path: ${{ github.workspace }}/app-compose/build/outputs/apk/foss/app-compose-foss-release.apk
- name: Upload built Market apk
if: success()
uses: actions/upload-artifact@v3
with:
name: app-compose-market-release.apk
path: ${{ github.workspace }}/app-compose/build/outputs/apk/market/release/app-compose-market-release.apk
- name: Upload mappings
if: success()
uses: actions/upload-artifact@v3
with:
name: mappings
path: "app-compose/build/outputs/mapping/marketRelease"
- name: Publish to Play Store internal test track
uses: r0adkll/upload-google-play@v1.1.1
with:
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }}
packageName: com.merxury.blocker
releaseFiles: app-compose/build/outputs/bundle/marketRelease/app-compose-market-release.aab
track: beta
inAppUpdatePriority: 2
mappingFile: app-compose/build/outputs/mapping/marketRelease/mapping.txt
- name: Set apk path
id: apk-path
run: |
foss_path=$(find **/build/outputs/apk/foss -name '*.apk' -type f | head -1)
echo "foss_path=$foss_path" >> $GITHUB_OUTPUT
market_path=$(find **/build/outputs/apk/market -name '*.apk' -type f | head -1)
echo "market_path=$market_path" >> $GITHUB_OUTPUT
- name: Get apk info
id: apk-info
uses: zhaobozhen/apk-info-action@1.1.2
with:
apk-path: ${{ steps.apk-path.outputs.foss_path }}
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4.0.0-b02
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
body: |
${{steps.build_changelog.outputs.changelog}}
${{ steps.apk-info.outputs.result }}
files: |
${{ steps.apk-path.outputs.foss_path }}
${{ steps.apk-path.outputs.market_path }}