diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef9ab90977..f6a8940db9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release +name: "Release" on: release: types: [published] @@ -13,119 +13,104 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_TOKEN }} - - name: Set up JDK + - name: "☕️ Setup JDK" uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: 'liberica' java-version: '17' - - name: Set the current release version + - name: "📝 Store the current release version" id: release_version run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT - - name: Run pre-release - uses: micronaut-projects/github-actions/pre-release@master + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Run Assemble + develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: "⚙ Run pre-release" + uses: micronaut-projects/github-actions/pre-release@master + - name: "🧩 Run Assemble" if: success() - id: assemble - uses: gradle/gradle-build-action@v3 - with: - arguments: assemble - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} - - name: Upload Distribution + run: ./gradlew assemble + - name: "📤 Upload Distribution" if: success() uses: actions/upload-artifact@v4 with: name: grails-gsp-${{ steps.release_version.outputs.value }}.zip path: ./**/build/libs/* - - name: Generate secring file + - 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 Sonatype OSSRH + - name: "📤 Publish to and close Sonatype staging repository" id: publish - uses: gradle/gradle-build-action@v3 env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SECRING_FILE: ${{ secrets.SECRING_FILE }} - with: - arguments: | - -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg - publishToSonatype - closeSonatypeStagingRepository + run: > + ./gradlew + -Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg + publishToSonatype + closeSonatypeStagingRepository release: needs: publish runs-on: ubuntu-latest permissions: contents: read steps: - - name: Checkout repository + - 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 + - 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: "🚀 Release Sonatype Staging Repository" env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} - with: - arguments: | - findSonatypeStagingRepository - releaseSonatypeStagingRepository - - name: Run post-release + run: > + ./gradlew + findSonatypeStagingRepository + releaseSonatypeStagingRepository + - name: "⚙️ Run post-release" if: success() uses: micronaut-projects/github-actions/post-release@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - env: - SNAPSHOT_SUFFIX: -SNAPSHOT docs: needs: publish runs-on: ubuntu-latest permissions: contents: write steps: - - name: Checkout repository + - name: "📥 Checkout repository" uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} ref: v${{ needs.publish.outputs.release_version }} - - name: Set up JDK + - name: "☕️ Setup JDK" uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: 'liberica' java-version: '17' - - name: Publish Documentation - id: docs - uses: gradle/gradle-build-action@v3 + - name: "🐘 Setup Gradle" + uses: gradle/actions/setup-gradle@v4 with: - arguments: docs - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} - - name: Publish to Github Pages + develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + - name: "📖 Generate documentation" + run: ./gradlew docs + - name: "📤 Publish documentation to Github Pages" if: success() uses: micronaut-projects/github-pages-deploy-action@grails env: - BETA: ${{ contains(needs.publish.outputs.release_version, 'M') }} + BETA: ${{ contains(needs.publish.outputs.release_version, 'M') || contains(needs.publish.outputs.release_version, 'RC') }} GH_TOKEN: ${{ secrets.GH_TOKEN }} BRANCH: gh-pages FOLDER: build/docs