Merge pull request #220 from WardPearce/fix/release-path-for-workflow #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 Android | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build APK | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./materialious | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install app dependencies | |
run: npm install | |
- name: Build Svelte app | |
run: npm run build | |
- name: Capacitor sync | |
run: npx cap sync | |
- name: Build app bundle | |
run: cd android && ./gradlew bundle | |
- name: Extract Android signing key from env | |
run: | | |
echo "${{ secrets.RELEASE_KEYSTORE }}" > android/release.jks.base64 | |
base64 -d android/release.jks.base64 > android/release.decrypted.jks | |
- name: Sign dev build | |
run: jarsigner -keystore android/release.decrypted.jks -storepass "${{ secrets.RELEASE_KEYSTORE_PASSWORD }}" -signedjar ./android/app/build/outputs/bundle/release/app-release-signed.aab ./android/app/build/outputs/bundle/release/app-release.aab release | |
- name: Upload release bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: app-release | |
path: ./materialious/android/app/build/outputs/bundle/release/app-release-signed.aab | |
- name: Upload APK to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./materialious/android/app/build/outputs/bundle/release/app-release-signed.aab | |
overwrite: true | |
file_glob: true |