This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
fix: an aftermath of implementing actions 8~10 #86 #32
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: Build Release App | |
on: | |
push: | |
paths: | |
- release_log.json | |
workflow_dispatch: | |
jobs: | |
build-release-apk: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Decode Contents | |
env: | |
KEY_STORE_CONTENTS: ${{ secrets.KEY_STORE_CONTENTS }} | |
GOOGLE_SERVICES_CONTENTS: ${{ secrets.GOOGLE_SERVICES_CONTENTS }} | |
run: | | |
if [ ! -d cicaches ]; then | |
mkdir cicaches | |
fi | |
echo $KEY_STORE_CONTENTS | base64 -di > cicaches/androidstudio-keystore.jks | |
echo $GOOGLE_SERVICES_CONTENTS | base64 -di > app/google-services.json | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build release apk | |
env: | |
SIGNING_STORE_FILE: ${{ secrets.SIGNING_STORE_FILE }} | |
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }} | |
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | |
run: | | |
if [ ! -f local.properties ]; then | |
touch local.properties | |
fi | |
SIGNING_STORE_FILE=${GITHUB_WORKSPACE}/${SIGNING_STORE_FILE} | |
./gradlew :app:assembleRelease | |
- name: Rename apk | |
run: mv app/build/outputs/apk/release/app-release.apk app/build/outputs/apk/release/shizurunotes-release.apk | |
- name: Generate release log | |
run: | | |
RELEASE_APK_VERSION=`python release.py` | |
echo "RELEASE_APK_VERSION=$RELEASE_APK_VERSION" >> $GITHUB_ENV | |
- name: Create a release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: releaselog_cache.txt | |
files: app/build/outputs/apk/release/shizurunotes-release.apk | |
tag_name: v${{ env.RELEASE_APK_VERSION }} | |
name: ShizuruNotes v${{ env.RELEASE_APK_VERSION }} | |
- name: Bump version | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "chore: bump to v${{ env.RELEASE_APK_VERSION }}" | |
git push | |
# - name: Upload Artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: shizurunotes.apk | |
# path: | | |
# app/build/outputs/apk/release/shizurunotes-release.apk |