Skip to content

Release

Release #90

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
grails_version:
description: 'Grails Version (eg: 4.0.6)'
required: true
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11']
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: puneetbehl
GIT_USER_EMAIL: behlp@unityfoundation.io
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- 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
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
env:
PATH_PREFIX: "./build/distributions/grails-docs"
- name: Tag and Release Docs
uses: ./.github/actions/tag-and-release
if: success() && github.event_name == 'workflow_dispatch'
with:
token: ${{ secrets.GITHUB_TOKEN }}
grails_version: ${{ github.event.inputs.grails_version }}
env:
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
- 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/gradle-build-action@v2
with:
arguments: assemble -PgithubBranch=${{ steps.extract_branch.outputs.value }} --info --stacktrace
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 }}
- 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: Determine docs target repository
if: success()
uses: haya14busa/action-cond@v1
id: docs_target
with:
cond: ${{ github.repository == 'grails/grails-doc' }}
if_true: 'grails/grails-doc'
if_false: ${{ github.repository }}
- name: Publish to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@grails
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
VERSION: ${{ github.event.inputs.grails_version }}
DOC_FOLDER: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}