Skip to content

bump version

bump version #1196

name: Release app
on:
push:
branches:
- main
jobs:
check_wrapper:
name: Validate Gradle Wrapper
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/[email protected]
build:
name: Build app
needs: check_wrapper
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Setup Android SDK
run: |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3"
- name: Clone repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Write google-services.json
uses: DamianReeves/[email protected]
with:
path: app/google-services.json
contents: ${{ secrets.GOOGLE_SERVICE_JSON }}
write-mode: overwrite # optional, default is preserve
- name: Build app
uses: eskatos/gradle-command-action@v3
with:
arguments: assembleStandardRelease
- name: Sign APK
id: sign_app
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/standard/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Get previous release
id: last_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease, draft
- name: Prepare build
run: |
set -e
current_sha=$(git rev-parse --short HEAD)
echo "CURRENT_SHA=$current_sha"
echo "CURRENT_SHA=$current_sha" >> $GITHUB_ENV
prev_release_sha=$(git rev-list -n 1 ${{ steps.last_release.outputs.release }})
echo "PREV_RELEASE_SHA=$prev_release_sha"
echo "PREV_RELEASE_SHA=$prev_release_sha" >> $GITHUB_ENV
echo "Url to compare: https://api.github.com/repos/nekomangaorg/neko/compare/$prev_release_sha...$current_sha"
echo "COMMIT_LOGS<<{delimiter}
$(curl -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/nekomangaorg/neko/compare/$prev_release_sha...$current_sha" \
| jq '[.commits[]|{message:(.commit.message | split("\n")), username:.author.login}]' \
| jq -r '.[]|"- \(.message | first) (@\(.username))"')
{delimiter}" >> $GITHUB_ENV
- name: Prep build artifacts for release
run: |
set -e
mv app/build/outputs/apk/standard/release/Neko-standard-universal-release-unsigned-signed.apk neko-universal.apk
sha=`sha256sum neko-universal.apk | awk '{ print $1 }'`
echo "APK_UNIVERSAL_SHA=$sha" >> $GITHUB_ENV
echo "| Universal | $sha" >> CurrentChangeLog.MD
cp app/build/outputs/apk/standard/release/Neko-standard-arm64-v8a-release-unsigned-signed.apk neko-arm64-v8a.apk
sha=`sha256sum neko-arm64-v8a.apk | awk '{ print $1 }'`
echo "APK_ARM64_V8A_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/Neko-standard-armeabi-v7a-release-unsigned-signed.apk neko-armeabi-v7a.apk
sha=`sha256sum neko-armeabi-v7a.apk | awk '{ print $1 }'`
echo "APK_ARMEABI_V7A_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/Neko-standard-x86-release-unsigned-signed.apk neko-x86.apk
sha=`sha256sum neko-x86.apk | awk '{ print $1 }'`
echo "APK_X86_SHA=$sha" >> $GITHUB_ENV
cp app/build/outputs/apk/standard/release/Neko-standard-x86_64-release-unsigned-signed.apk neko-x86_64.apk
sha=`sha256sum neko-x86_64.apk | awk '{ print $1 }'`
echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV
- name: Delete release draft
uses: hugo19941994/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
body: |
## 🥳 New
## 🏗️ Changes
## 🐜 Fixes
## 🛠️ Other
${{ env.COMMIT_LOGS }}
| Variant | SHA-256 |
| ------- | ------- |
| Universal | ${{ env.APK_UNIVERSAL_SHA }}
| arm64-v8a | ${{ env.APK_ARM64_V8A_SHA }}
| armeabi-v7a | ${{ env.APK_ARMEABI_V7A_SHA }}
| x86 | ${{ env.APK_X86_SHA }}
| x86_64 | ${{ env.APK_X86_64_SHA }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
replacesArtifacts: true
tag: "latest"
artifacts: "*.apk"