Update gradle/actions action to v4 (#139) #310
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build app | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repo | |
uses: actions/checkout@v4 | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build app | |
run: ./gradlew assemblePlaystoreRelease | |
# Sign APK and create release for tags | |
- name: Prepare build metadata | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LISTEN-moe/android-app' | |
run: | | |
set -x | |
echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Sign app bundle | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LISTEN-moe/android-app' | |
uses: r0adkll/sign-android-release@v1 | |
with: | |
releaseDirectory: app/build/outputs/apk/playstore/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: "35.0.0" | |
- name: Create release | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'LISTEN-moe/android-app' | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.VERSION_TAG }} | |
name: ${{ env.VERSION_TAG }} | |
files: | | |
${{ env.SIGNED_RELEASE_FILE }} | |
draft: true | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |