Release #111
This file contains 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: | |
workflow_dispatch: | |
inputs: | |
grails_version: | |
description: 'Grails Version (eg: 4.0.6)' | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
env: | |
BETA: ${{ contains(github.event.inputs.grails_version, 'M') }} | |
SKIP_SNAPSHOT: ${{ | |
startsWith(github.event.inputs.grails_version, '3.3') || | |
startsWith(github.event.inputs.grails_version, '4.1') || | |
startsWith(github.event.inputs.grails_version, '5.3') || | |
contains(github.event.inputs.grails_version, 'M') || | |
contains(github.event.inputs.grails_version, 'RC') | |
}} | |
GIT_USER_NAME: 'grails-build' | |
GIT_USER_EMAIL: '[email protected]' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/wrapper-validation-action@v2 | |
- uses: actions/setup-java@v4 | |
with: { java-version: 17, distribution: temurin } | |
- name: Extract branch name | |
if: success() && github.event_name == 'workflow_dispatch' | |
id: extract_branch | |
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT | |
- name: Asset Path | |
if: success() && github.event_name == 'workflow_dispatch' | |
id: asset_path | |
uses: haya14busa/action-cond@v1 | |
env: | |
PATH_PREFIX: "./build/distributions/grails-docs" | |
with: | |
cond: ${{ env.BETA == '' || env.BETA == 'false' }} | |
if_true: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.grails_version }}.zip | |
if_false: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.grails_version }}.zip | |
- name: Tag and Release Docs | |
uses: ./.github/actions/tag-and-release | |
if: success() && github.event_name == 'workflow_dispatch' | |
env: | |
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }} | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
grails_version: ${{ github.event.inputs.grails_version }} | |
- name: Create Release | |
if: success() && github.event_name == 'workflow_dispatch' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.event.inputs.grails_version }} | |
release_name: v${{ github.event.inputs.grails_version }} | |
draft: false | |
prerelease: ${{ env.BETA }} | |
- name: Publish Documentation | |
uses: gradle/actions/setup-gradle@v3 | |
env: | |
TARGET_GRAILS_VERSION: ${{ github.event.inputs.grails_version }} | |
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }} | |
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 }} | |
with: | |
arguments: | | |
assemble | |
-PgithubBranch=${{ steps.extract_branch.outputs.value }} | |
--info | |
--stacktrace | |
- name: Upload Release Asset | |
if: success() && github.event_name == 'workflow_dispatch' | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.asset_path.outputs.value }} | |
asset_name: grails-docs.zip | |
asset_content_type: application/zip | |
- name: Publish to Github Pages | |
if: success() | |
uses: grails/github-pages-deploy-action@v2 | |
env: | |
BRANCH: gh-pages | |
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | |
COMMIT_NAME: ${{ env.GIT_USER_NAME }} | |
FOLDER: build/docs | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
TARGET_REPOSITORY: ${{ github.repository }} | |
VERSION: ${{ github.event.inputs.grails_version }} |