diff --git a/.github/actions/prepare-keystore/action.yml b/.github/actions/prepare-keystore/action.yml new file mode 100644 index 0000000..266802f --- /dev/null +++ b/.github/actions/prepare-keystore/action.yml @@ -0,0 +1,31 @@ +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 + +runs: + using: composite + steps: + - name: Write Keystore file 🗄️ + id: android_keystore + uses: timheuer/base64-to-file@v1.0.3 + with: + fileName: key.jks + encodedString: ${{ secrets.KEYSTORE }} + + - 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 diff --git a/.github/workflows/release-app.yaml b/.github/workflows/release-app-github.yaml similarity index 51% rename from .github/workflows/release-app.yaml rename to .github/workflows/release-app-github.yaml index c7925d9..5c8bc57 100644 --- a/.github/workflows/release-app.yaml +++ b/.github/workflows/release-app-github.yaml @@ -12,19 +12,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Write Keystore file 🗄️ - id: android_keystore - uses: timheuer/base64-to-file@v1.0.3 + - name: Write KeyStore 🗝️ + uses: ./.github/actions/prepare-keystore with: - fileName: key.jks - encodedString: ${{ secrets.KEYSTORE }} - - - name: Write Keystore properties 🗝️ - run: | - echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > key.properties - echo "storePassword=${{ secrets.SIGNING_STORE_PASSWORD }}" >> key.properties - echo "keyPassword=${{ secrets.SIGNING_KEY_PASSWORD }}" >> key.properties - echo "keyAlias=${{ secrets.SIGNING_KEY_ALIAS }}" >> key.properties + signingStorePassword: ${{ secrets.SIGNING_STORE_PASSWORD }} + signingKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} + signingKeyAlias: ${{ secrets.SIGNING_KEY_ALIAS }} - name: Setup Java uses: actions/setup-java@v3