Update github snapshot release on build #8
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 Signed Release | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'dev' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up JDK 18 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '18' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Decode Keystore | |
id: decode_keystore | |
uses: timheuer/base64-to-file@v1.2 | |
with: | |
fileName: 'android_keystore.jks' | |
encodedString: ${{ secrets.KEYSTORE }} | |
- name: Set snapshot | |
run: | | |
echo "IS_SNAPSHOT=true" >> "$GITHUB_ENV" | |
if: github.ref == 'refs/heads/dev' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build APK and app bundle | |
run: ./gradlew bundleRelease assembleRelease | |
env: | |
RELEASE_STORE_FILE: ${{ steps.decode_keystore.outputs.filePath }} | |
RELEASE_STORE_PASSWORD : ${{ secrets.RELEASE_STORE_PASSWORD }} | |
RELEASE_KEY_ALIAS : ${{ secrets.RELEASE_KEY_ALIAS }} | |
RELEASE_KEY_PASSWORD : ${{ secrets.RELEASE_KEY_PASSWORD }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: AppBundle | |
path: build/outputs/bundle/release/* | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
name: APK | |
path: build/outputs/apk/release/* | |
- name: Set version variables | |
run: | | |
VER=$(cat version.txt) | |
echo "VERSION=$VER" >> $GITHUB_ENV | |
- name: Update snapshot release | |
uses: johnwbyrd/update-release@v1 | |
if: github.ref == 'refs/heads/dev' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: build/outputs/apk/release/* README.md | |
prerelease: true | |
release: ${{ env.VERSION }} |