chore: automated playstore distribution (#94) #75
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 alpha release | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
semantic-release: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
outputs: | |
release: ${{ steps.tag_release.outputs.release }} | |
version: ${{ steps.tag_release.outputs.version }} | |
steps: | |
- uses: dyne/pnpm@main | |
with: | |
node-version: 20 | |
pnpm-version: 8 | |
- name: Tag release | |
id: tag_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npx semantic-release >semantic-release.log | |
cat semantic-release.log | |
if [[ `git tag --points-at HEAD` == "" ]]; then | |
echo "release=False" >> $GITHUB_OUTPUT | |
else | |
echo "release=True" >> $GITHUB_OUTPUT | |
awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT | |
fi | |
echo "Result" | |
cat $GITHUB_OUTPUT | |
build_android: | |
runs-on: ubuntu-latest | |
needs: semantic-release | |
if: ${{ needs.semantic-release.outputs.release == 'True' }} | |
steps: | |
- uses: dyne/pnpm@main | |
with: | |
submodules: true | |
node-version: 20 | |
pnpm-version: 8 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: '17' | |
- name: Decode Keystore File | |
uses: timheuer/base64-to-file@v1 | |
id: android_keystore | |
with: | |
fileName: android_keystore.keystore | |
encodedString: ${{ secrets.ANDROID_KEYSTORE_FILE }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.0' | |
bundler-cache: true | |
- uses: maierj/[email protected] | |
env: | |
KEYSTORE_PATH: ${{ steps.android_keystore.outputs.filePath }} | |
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} | |
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }} | |
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }} | |
PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }} | |
with: | |
lane: alpha | |
- run: mv release.apk verifier.apk | |
- name: relase all binary artifacts | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
verifier.apk | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: true | |
generate_release_notes: true | |
tag_name: ${{ needs.semantic-release.outputs.version }} |