Release #91
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 | |
strategy: | |
matrix: | |
java: ['8'] | |
env: | |
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@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
- name: Extract branch name | |
if: success() && github.event_name == 'workflow_dispatch' | |
id: extract_branch | |
run: echo ::set-output name=value::${GITHUB_REF:11} | |
- 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 | |
run: | | |
./gradlew --stop | |
(set -x; ./gradlew assemble -PgithubBranch=$TARGET_BRANCH --info --stacktrace) | |
env: | |
TARGET_GRAILS_VERSION: ${{ github.event.inputs.grails_version }} | |
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }} | |
- 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: grails/github-pages-deploy-action@v2 | |
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 }} | |
SKIP_SNAPSHOT: true | |
SKIP_LATEST: true | |
DOC_FOLDER: gh-pages | |
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }} | |
COMMIT_NAME: ${{ env.GIT_USER_NAME }} |