Merge pull request #6 from Emotional-Wellbeing/dominguez #68
Workflow file for this run
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 App | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- 'v*' | |
- '!*alpha*' | |
- '!*beta*' | |
- '!*rc*' | |
permissions: | |
contents: write | |
# jobs are run in parallel on different machines | |
# all steps run in series | |
jobs: | |
release: | |
name: Release App | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup build tool version variable | |
shell: bash | |
run: | | |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
echo Last build tool version is: $BUILD_TOOL_VERSION | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' #Eclipse | |
java-version: '17' | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Run Linters and Test | |
run: ./gradlew check | |
- name: Upload Reports if not tag | |
uses: actions/upload-artifact@v3 | |
if: startsWith(github.ref, 'refs/tags/') == false | |
with: | |
name: test-reports | |
path: app/build/reports | |
- name: Zip Test Results | |
uses: montudor/action-zip@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
args: zip -qq -r test-reports.zip app/build/reports | |
- name: Build with Gradle | |
if: startsWith(github.ref, 'refs/tags/') | |
run: ./gradlew build | |
# Waiting Play Store integration.. | |
# - name: Build Release AAB | |
# run: ./gradlew bundleRelease | |
#path app/build/outputs/bundle/release/app-release.aab | |
- name: Build Release APK | |
if: startsWith(github.ref, 'refs/tags/') | |
run: ./gradlew assembleRelease --stacktrace | |
#path app/build/outputs/apk/release/app-release-unsigned.apk | |
- name: Rename Release APK | |
#skip app-release-unsigned-signed.apk case | |
if: startsWith(github.ref, 'refs/tags/') | |
run: mv app/build/outputs/apk/release/app-release-unsigned.apk app/build/outputs/apk/release/app-release.apk | |
- name: Sign APK Release | |
id: sign_apk | |
uses: r0adkll/sign-android-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
releaseDirectory: app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.KEY_STORE_FILE }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
alias: ${{ secrets.KEY_ALIAS }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
# Waiting Play Store integration.. | |
# - name: Sign AAB | |
# id: sign_aab | |
# uses: r0adkll/sign-android-release@v1 | |
# with: | |
# releaseDirectory: app/build/outputs/bundle/release | |
# signingKeyBase64: ${{ secrets.KEY_STORE_FILE }} | |
# keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
# alias: ${{ secrets.KEY_ALIAS }} | |
# keyPassword: ${{ secrets.KEY_PASSWORD }} | |
#path ${{steps.sign_aab.outputs.signedReleaseFile}} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: Release ${{ github.ref_name }} | |
files: | | |
${{steps.sign_apk.outputs.signedReleaseFile}} | |
test-reports.zip |