Skip to content

Release

Release #16

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
publish:
outputs:
release_version: ${{ steps.release_version.outputs.value }}
runs-on: ubuntu-latest
permissions:
contents: read
env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: '[email protected]'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: Set the current release version
id: release_version
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Run pre-release
uses: grails/github-actions/pre-release@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Assemble
if: success()
id: assemble
uses: gradle/gradle-build-action@v3
with:
arguments: assemble
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Distribution
if: success()
uses: actions/upload-artifact@v4
with:
name: grails-gsp-${{ steps.release_version.outputs.value }}
path: ./**/build/libs/*
- name: Generate secring file
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: Publish to Sonatype OSSRH
id: publish
uses: gradle/gradle-build-action@v3
env:
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_NEXUS_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 }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publishToSonatype
closeSonatypeStagingRepository
release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Nexus Staging Close And Release
uses: gradle/gradle-build-action@v3
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
NEXUS_PUBLISH_USERNAME: ${{ secrets.NEXUS_PUBLISH_USERNAME }}
NEXUS_PUBLISH_PASSWORD: ${{ secrets.NEXUS_PUBLISH_PASSWORD }}
NEXUS_PUBLISH_NEXUS_URL: ${{ secrets.NEXUS_PUBLISH_RELEASE_URL }}
NEXUS_PUBLISH_STAGING_PROFILE_ID: ${{ secrets.NEXUS_PUBLISH_STAGING_PROFILE_ID }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
with:
arguments: |
findSonatypeStagingRepository
releaseSonatypeStagingRepository
- name: Run post-release
if: success()
uses: grails/github-actions/post-release@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
SNAPSHOT_SUFFIX: -SNAPSHOT
docs:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: v${{ needs.publish.outputs.release_version }}
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: Publish Documentation
id: docs
if: success()
uses: gradle/gradle-build-action@v3
with:
arguments: docs
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Github Pages
if: steps.docs.outcome == 'success'
uses: grails/github-pages-deploy-action@v2
env:
SKIP_LATEST: ${{ contains(steps.release_version.outputs.release_version, 'M') }}
TARGET_REPOSITORY: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
DOC_FOLDER: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
VERSION: ${{ steps.release_version.outputs.release_version }}