-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add production release GitHub Actions workflow #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| name: Release | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||
| tags: | ||||||||||||||||||||||||||||||||||||||||||||
| - 'v*' | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Set up JDK 17 | ||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||
| java-version: '17' | ||||||||||||||||||||||||||||||||||||||||||||
| distribution: 'temurin' | ||||||||||||||||||||||||||||||||||||||||||||
| cache: gradle | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Grant execute permission for gradlew | ||||||||||||||||||||||||||||||||||||||||||||
| run: chmod +x gradlew | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| # Decode the base64-encoded keystore stored in GitHub Secrets and write it | ||||||||||||||||||||||||||||||||||||||||||||
| # to a file that Gradle can reference during the signing step. | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Decode keystore | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| echo "${{ secrets.KEYSTORE_FILE }}" | base64 --decode > ${{ github.workspace }}/release.jks | ||||||||||||||||||||||||||||||||||||||||||||
| chmod 600 ${{ github.workspace }}/release.jks | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| # Write keystore.properties so that app/build.gradle.kts can pick up | ||||||||||||||||||||||||||||||||||||||||||||
| # all signing credentials at build time (mirrors keystore.properties.template). | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Write keystore.properties | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| cat > ${{ github.workspace }}/keystore.properties <<EOF | ||||||||||||||||||||||||||||||||||||||||||||
| storeFile=${{ github.workspace }}/release.jks | ||||||||||||||||||||||||||||||||||||||||||||
| storePassword=${{ secrets.KEYSTORE_PASSWORD }} | ||||||||||||||||||||||||||||||||||||||||||||
| keyAlias=${{ secrets.KEY_ALIAS }} | ||||||||||||||||||||||||||||||||||||||||||||
| keyPassword=${{ secrets.KEY_PASSWORD }} | ||||||||||||||||||||||||||||||||||||||||||||
| EOF | ||||||||||||||||||||||||||||||||||||||||||||
| chmod 600 ${{ github.workspace }}/keystore.properties | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+39
to
+46
|
||||||||||||||||||||||||||||||||||||||||||||
| run: | | |
| cat > ${{ github.workspace }}/keystore.properties <<EOF | |
| storeFile=${{ github.workspace }}/release.jks | |
| storePassword=${{ secrets.KEYSTORE_PASSWORD }} | |
| keyAlias=${{ secrets.KEY_ALIAS }} | |
| keyPassword=${{ secrets.KEY_PASSWORD }} | |
| EOF | |
| chmod 600 ${{ github.workspace }}/keystore.properties | |
| env: | |
| WORKSPACE: ${{ github.workspace }} | |
| STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| run: | | |
| printf '%s\n' \ | |
| "storeFile=$WORKSPACE/release.jks" \ | |
| "storePassword=$STORE_PASSWORD" \ | |
| "keyAlias=$KEY_ALIAS" \ | |
| "keyPassword=$KEY_PASSWORD" \ | |
| > "$WORKSPACE/keystore.properties" | |
| chmod 600 "$WORKSPACE/keystore.properties" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release.jksandkeystore.propertiesremain on disk for the rest of the job. Consider removing them immediately afterbundleRelease(or in a final cleanup step withif: always()) to reduce the chance of accidental exposure via later steps/artifacts/logs.