Skip to content

Commit

Permalink
ci: complete release ci configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Jan 17, 2024
1 parent 64fd983 commit ee9e899
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release ci
name: Release
on:
push:
tags:
Expand All @@ -20,48 +20,50 @@ jobs:
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: script/cache-hash.sh
run: |
./gradlew :app:calculateNativeCacheHash
- name: Fetch JNI cache
uses: actions/cache@v3
id: jni-cache
with:
path: "app/prebuilt"
key: ${{ runner.os }}-trime-jni-debug-${{ steps.cache-hash.outputs.hash }}
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 Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 21
# will restore cache of dependencies and wrappers
cache: 'gradle'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup keystore
run: |
echo "set up keystore for release"
echo "need help!!"
- name: Install dependency
run: ./script/dependency.sh
echo ${{ secrets.SIGNING_KEY }} | base64 --decode | cat >> signingkey.jks
cat << EOF > keystore.properties
storeFile=signingkey.jks
storePassword=${{ secrets.KEY_STORE_PASSWORD }}
keyAlias=${{ secrets.ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF
- name: Build Trime
run: make debug
run: make release

- name: Add JNI cache
if: ${{ !steps.jni-cache.outputs.cache-hit }}
# TODO: replace debug with release after we switched to "make release"
run: cp -R app/build/intermediates/stripped_native_libs/debug/out/lib app/prebuilt
run: cp -R app/build/intermediates/stripped_native_libs/release/out/lib app/prebuilt

- name: Build changelog
id: build_changelog
Expand All @@ -79,7 +81,7 @@ jobs:
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/apk/**/*.apk"
artifacts: "app/build/outputs/apk/release/*.apk"
body: |
${{ steps.build_changelog.outputs.changelog }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ee9e899

Please sign in to comment.