ci: use built-in generated release notes on nightly build #20
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 | |
on: | |
push: | |
branches: | |
- develop | |
tags: | |
- '*' | |
env: | |
CI_NAME: Release CI | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get branch name | |
id: vars | |
run: | | |
echo ${GITHUB_REF#refs/*/} | |
echo CI_BRANCH=${GITHUB_REF#refs/*/} >> $GITHUB_ENV | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: 21 | |
# will restore cache of dependencies and wrappers | |
cache: 'gradle' | |
- name: Calculate JNI cache hash | |
id: cache-hash | |
run: | | |
./gradlew :app:calculateNativeCacheHash | |
- name: Fetch JNI cache | |
uses: actions/cache@v3 | |
id: jni-cache | |
with: | |
path: "app/prebuilt" | |
key: ${{ runner.os }}-trime-jni-release-${{ steps.cache-hash.outputs.native-cache-hash }} | |
- name: Fetch submodules | |
if: ${{ !steps.jni-cache.outputs.cache-hit }} | |
run: | | |
git submodule update --init --recursive | |
- name: Setup Android SDK | |
uses: android-actions/setup-android@v3 | |
- name: Setup keystore | |
run: | | |
echo ${{ secrets.SIGNING_KEY }} | base64 --decode | cat >> $(pwd)/signingkey.jks | |
cat << EOF > keystore.properties | |
storeFile=$(pwd)/signingkey.jks | |
storePassword=${{ secrets.KEY_STORE_PASSWORD }} | |
keyAlias=${{ secrets.ALIAS }} | |
keyPassword=${{ secrets.KEY_PASSWORD }} | |
EOF | |
- name: Build Trime | |
run: make release | |
- name: Add JNI cache | |
if: ${{ !steps.jni-cache.outputs.cache-hit }} | |
run: cp -R app/build/intermediates/stripped_native_libs/release/out/lib app/prebuilt | |
- name: Build changelog | |
id: build_changelog | |
uses: mikepenz/release-changelog-builder-action@v4 | |
with: | |
commitMode: true | |
configurationJson: | | |
{ | |
"template": "Change log from #{{FROM_TAG}} to #{{TO_TAG}}: #{{RELEASE_DIFF}}\n#{{UNCATEGORIZED}}", | |
"pr_template": "- [#{{MERGE_SHA}}] - #{{TITLE}}" | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Nightly release | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
prerelease: true | |
artifacts: "app/build/outputs/apk/release/*.apk" | |
name: "Nightly Build" | |
tag: nightly | |
generateReleaseNotes: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Stable release | |
if: ${{ github.ref != 'refs/heads/develop' }} | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') }} | |
artifacts: "app/build/outputs/apk/release/*.apk" | |
body: | | |
${{ steps.build_changelog.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} |