Increment versionCode #92
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 | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get tag version | |
id: get_version | |
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT | |
- name: Set up environment | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Restore json key | |
run: echo "${{ secrets.GOOGLE_API_PUB_JSON_BASE64 }}" | base64 --decode > ${{ github.workspace }}/service-account.json | |
- name: Restore keystore | |
run: echo "${{ secrets.GOOGLE_KEYSTORE_BASE64 }}" | base64 --decode > ${{ github.workspace }}/demoscannerapp/debug.keystore | |
- name: Gradle cache | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0.2 | |
bundler-cache: true | |
- name: Gradle build | |
run: ./gradlew build | |
env: # demo app signingConfigs requires all its variables already or the build will fail | |
KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_KEYSTORE_PASSWORD }} # For demo app AAB | |
SIGNKEY_PASSWORD: ${{ secrets.GOOGLE_SIGNKEY_PASSWORD }} # For demo app AAB | |
KEY_ALIAS: ${{ secrets.GOOGLE_SIGNKEY_ALIAS }} # For demo app AAB | |
GH_DRIVER_REPOSITORY_USERNAME: ${{ secrets.GH_DRIVER_REPOSITORY_USERNAME }} | |
GH_DRIVER_REPOSITORY_TOKEN: ${{ secrets.GH_DRIVER_REPOSITORY_TOKEN }} | |
- name: Publish the library to MavenCentral | |
run: ./gradlew publish | |
env: | |
OSSRH_LOGIN: ${{ secrets.OSSRH_LOGIN }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
SIGN_KEYID: ${{ secrets.SIGN_KEYID }} | |
SIGN_KEY: ${{ secrets.SIGN_KEY }} | |
SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} | |
LIB_VERSION: ${{ steps.get_version.outputs.VERSION }} | |
GH_DRIVER_REPOSITORY_USERNAME: ${{ secrets.GH_DRIVER_REPOSITORY_USERNAME }} | |
GH_DRIVER_REPOSITORY_TOKEN: ${{ secrets.GH_DRIVER_REPOSITORY_TOKEN }} | |
- name: Fastlane build and upload | |
run: bundle exec fastlane internal | |
env: | |
KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_KEYSTORE_PASSWORD }} | |
SIGNKEY_PASSWORD: ${{ secrets.GOOGLE_SIGNKEY_PASSWORD }} | |
KEY_ALIAS: ${{ secrets.GOOGLE_SIGNKEY_ALIAS }} | |
- name: Rename the AAB file for GitHub release upload | |
run: mv demoscannerapp/build/outputs/bundle/release/demoscannerapp-release.aab demoscannerapp/build/outputs/bundle/release/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aab | |
- name: Create a GitHub release with the AAR file as an asset | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ steps.get_version.outputs.VERSION }} | |
files: demoscannerapp/build/outputs/bundle/release/enioka_scan-${{ steps.get_version.outputs.VERSION }}.aab | |
token: ${{ secrets.GITHUB_TOKEN }} |