Release Build #39
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 Build | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
cache-disabled: true | |
- name: Build with Gradle | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew assembleRelease --no-daemon | |
- name: Sign APK | |
id: sign_apk | |
uses: ilharp/sign-android-release@v1 | |
with: | |
releaseDir: ./app/build/outputs/apk/release/ | |
signingKey: ${{ secrets.SIGNING_KEYSTORE }} | |
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }} | |
keyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} | |
keyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
- name: Set current date as env variable | |
run: echo "date_now=$(date +'%d.%m.%Y')" >> $GITHUB_ENV | |
- name: Add version to APK | |
run: mv ${{ steps.sign_apk.outputs.signedFile }} revanced-manager-compose-${{ env.date_now }}.apk | |
- name: Upload APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: compose-'${{ env.date_now }}' | |
path: ${{ steps.sign_apk.outputs.signedFile }} | |
- name: Publish APK | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ env.date_now }}" | |
prerelease: false | |
title: "compose-${{ env.date_now }}" | |
files: revanced-manager-compose-${{ env.date_now }}.apk |