This repository was archived by the owner on Mar 13, 2025. It is now read-only.
9.0.0-M3 #38
Workflow file for this run
This file contains hidden or 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: "Release" | |
on: | |
release: | |
types: [published] | |
env: | |
GIT_USER_NAME: grails-build | |
GIT_USER_EMAIL: [email protected] | |
jobs: | |
publish: | |
name: "Publish to Sonatype Staging Repository" | |
outputs: | |
release_version: ${{ steps.release_version.outputs.value }} | |
target_branch: ${{ steps.extract_branch.outputs.value }} | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: "π₯ Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: liberica | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "βοΈ Run pre-release" | |
uses: grails/github-actions/pre-release@main | |
- name: "π Determine Target Branch" | |
id: extract_branch | |
run: | | |
echo "Determining Target Branch" | |
TARGET_BRANCH=`cat $GITHUB_EVENT_PATH | jq '.release.target_commitish' | sed -e 's/^"\(.*\)"$/\1/g'` | |
echo $TARGET_BRANCH | |
echo "value=${TARGET_BRANCH}" >> $GITHUB_OUTPUT | |
- name: "π Store the current release version" | |
id: release_version | |
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | |
- name: "π§© Run Assemble" | |
if: success() | |
id: assemble | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew --refresh-dependencies assemble | |
- name: "π Generate key file for artifact signing" | |
env: | |
SECRING_FILE: ${{ secrets.SECRING_FILE }} | |
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg | |
- name: "π€ Publish to and close Sonatype staging repository" | |
id: publish | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
GRAILS_PUBLISH_RELEASE: 'true' | |
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} | |
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} | |
NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} | |
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} | |
run: > | |
./gradlew --no-build-cache | |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg | |
publishToSonatype | |
closeSonatypeStagingRepository | |
release: | |
environment: release | |
name: "Release Sonatype Staging Repository" | |
needs: publish | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: "π₯ Checkout repository" | |
uses: actions/checkout@v4 | |
with: | |
ref: v${{ needs.publish.outputs.release_version }} | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: liberica | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "π Release Sonatype Staging Repository" | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
GRAILS_PUBLISH_RELEASE: 'true' | |
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }} | |
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }} | |
NEXUS_PUBLISH_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }} | |
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} | |
run: > | |
./gradlew | |
findSonatypeStagingRepository | |
releaseSonatypeStagingRepository | |
- name: "βοΈ Run post-release" | |
if: success() | |
uses: grails/github-actions/post-release@main | |
docs: | |
environment: release | |
name: "Publish Documentation" | |
needs: publish | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: "π₯ Checkout repository" | |
uses: actions/checkout@v4 | |
with: | |
ref: v${{ needs.publish.outputs.release_version }} | |
- name: "βοΈ Setup JDK" | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'liberica' | |
java-version: '17' | |
- name: "π Setup Gradle" | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} | |
- name: "π Generate documentation" | |
env: | |
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: ./gradlew docs:docs | |
- name: "π« Export Gradle Properties" | |
uses: grails/github-actions/export-gradle-properties@v3 | |
- name: "π Determine docs target repository" | |
if: success() | |
uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1 (Use commit sha as this is a 3rd party action) | |
id: docs_target | |
with: | |
cond: ${{ github.repository == 'grails/gorm-mongodb' }} | |
if_true: grails/grails-data-mapping | |
if_false: ${{ github.repository }} | |
- name: "π€ Publish to Github Pages" | |
if: success() | |
uses: grails/github-pages-deploy-action@v3 | |
env: | |
BETA: ${{ contains(steps.release_version.outputs.release_version, 'M') || contains(steps.release_version.outputs.release_version, 'RC') }} | |
BRANCH: gh-pages | |
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | |
COMMIT_NAME: ${{ env.GIT_USER_NAME }} | |
DOC_FOLDER: gh-pages | |
DOC_SUB_FOLDER: mongodb | |
FOLDER: docs/build/docs | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }} | |
VERSION: ${{ needs.publish.outputs.release_version }} |