scottenock has triggered an Android Release #11
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 APK | |
run-name: ${{ github.actor }} has triggered an Android Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
- name: Use Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "corretto" | |
java-version: "17" | |
- name: Install xmlstarlet | |
run: | | |
apt update | |
apt install xmlstarlet | |
- run: npm ci | |
- run: npm test | |
- run: npm run build --if-present | |
- name: Decode Keystore | |
id: decode_keystore | |
uses: timheuer/base64-to-file@v1 | |
with: | |
fileName: "keystore.jks" | |
encodedString: ${{ secrets.KEYSTORE }} | |
- name: Extract release version | |
id: extract_tag | |
run: echo "TAG_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV | |
- name: Update config.xml | |
run: | | |
xmlstarlet ed -N w="http://www.w3.org/ns/widgets" -u "/w:widget/@version" -v "${{ env.TAG_VERSION }}" cordova/config.xml | |
- name: build APK | |
run: | | |
cd cordova | |
npm i -D cordova | |
npx cordova platform add android@13 | |
npx cordova build android --release -- --keystore="${{ steps.decode_keystore.outputs.filePath }}" --storePassword="${{ secrets.SIGNING_STORE_PASSWORD }}" --alias="${{ secrets.SIGNING_KEY_ALIAS }}" --password="${{ secrets.SIGNING_KEY_PASSWORD }}" | |
- name: Upload Release Build | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: cordova/platforms/android/app/build/outputs/bundle/release/app-release.aab |