mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
feat(ci-cd): Build and upload app on publish events
This commit is contained in:
parent
6d104f994d
commit
84da393e0d
34
.github/actions/prepare-keystore/action.yml
vendored
Normal file
34
.github/actions/prepare-keystore/action.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: Prepare KeyStore
|
||||||
|
description: Write the KeyStore file and properties to disk
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
signingStorePassword:
|
||||||
|
description: 'The password for the KeyStore'
|
||||||
|
required: true
|
||||||
|
signingKeyPassword:
|
||||||
|
description: 'The password for the Key'
|
||||||
|
required: true
|
||||||
|
signingKeyAlias:
|
||||||
|
description: 'The alias for the Key'
|
||||||
|
required: true
|
||||||
|
keyStoreBase64:
|
||||||
|
description: 'The KeyStore file encoded as base64'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Write Keystore file 🗄️
|
||||||
|
id: android_keystore
|
||||||
|
uses: timheuer/base64-to-file@v1.0.3
|
||||||
|
with:
|
||||||
|
fileName: key.jks
|
||||||
|
encodedString: ${{ inputs.keyStoreBase64 }}
|
||||||
|
|
||||||
|
- name: Write Keystore properties 🗝️
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > key.properties
|
||||||
|
echo "storePassword=${{ inputs.signingStorePassword }}" >> key.properties
|
||||||
|
echo "keyPassword=${{ inputs.signingKeyPassword }}" >> key.properties
|
||||||
|
echo "keyAlias=${{ inputs.signingKeyAlias }}" >> key.properties
|
52
.github/workflows/release-app-github.yaml
vendored
Normal file
52
.github/workflows/release-app-github.yaml
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
name: Build and publish app
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-app-github:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: gradle/wrapper-validation-action@v2
|
||||||
|
|
||||||
|
- name: Write KeyStore 🗝️
|
||||||
|
uses: ./.github/actions/prepare-keystore
|
||||||
|
with:
|
||||||
|
signingStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }}
|
||||||
|
signingKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }}
|
||||||
|
signingKeyAlias: ${{ secrets.SIGNING_KEY_ALIAS }}
|
||||||
|
keyStoreBase64: ${{ secrets.KEYSTORE }}
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: 21
|
||||||
|
cache: 'gradle'
|
||||||
|
|
||||||
|
- name: Build APKs 📱
|
||||||
|
run: ./gradlew assembleRelease
|
||||||
|
|
||||||
|
- name: Build AABs 📱
|
||||||
|
run: ./gradlew bundleRelease
|
||||||
|
|
||||||
|
- name: Upload APKs 🚀
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
with:
|
||||||
|
files: app/build/outputs/apk/fdroid/release/*.apk
|
||||||
|
|
||||||
|
- name: Upload APKs bundles 🚀
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
with:
|
||||||
|
files: app/build/outputs/bundle/fdroidRelease/*.aab
|
Loading…
x
Reference in New Issue
Block a user