Skip to content

Release version 0.2.0 #3

Release version 0.2.0

Release version 0.2.0 #3

name: Release a new version in maven repositories
on:
push:
tags:
- "v[0-9]+.[0-9]+.*"
jobs:
release-version:
name: Release library version
# Should be macOS to be able to create iOS variants as well
runs-on: macos-latest
env:
# For information about signing.* properties,
# see comments on signing { ... } block in the library build file
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY_CONTENT_BASE64: ${{ secrets.SIGNING_KEY_CONTENT_BASE64 }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: write
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up a specific Java version
uses: actions/setup-java@v4
with:
distribution: "temurin" # OR adopt OR microsoft OR...
java-version: "21"
- name: Decode the private GPG key file stored in GitHub secrets
run: echo $SIGNING_KEY_CONTENT_BASE64 | base64 -d > private-key.gpg
- name: Release to local repository
id: release-local
run: >
./gradlew publishAllPublicationsToCustomLocalRepository
-Psigning.secretKeyRingFile="../private-key.gpg"
-Psigning.password="$SIGNING_PASSWORD"
-Psigning.keyId="$SIGNING_KEY_ID"
--stacktrace
- name: Release to GitHub Packages
if: always() && steps.release-local.outcome == 'success'
run: >
./gradlew publishAllPublicationsToGitHubPackagesRepository
-Psigning.secretKeyRingFile="../private-key.gpg"
-Psigning.password="$SIGNING_PASSWORD"
-Psigning.keyId="$SIGNING_KEY_ID"
--stacktrace
- name: Release to Maven Central
if: always() && steps.release-local.outcome == 'success'
run: >
./gradlew publishAllPublicationsToMavenCentralRepository
-Psigning.secretKeyRingFile="../private-key.gpg"
-Psigning.password="$SIGNING_PASSWORD"
-Psigning.keyId="$SIGNING_KEY_ID"
--stacktrace
- name: Store the publication at the bottom of the workflow summary page
uses: actions/upload-artifact@v4
with:
name: resultPublication
path: |
library/build/local-repository/