Skip to content

Release

Release #69

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
gorm_version:
description: 'Gorm Version (eg: 7.0.8)'
required: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
BETA: ${{ contains(github.event.inputs.gorm_version, 'M') }}
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@unityfoundation.io
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11
- name: Extract branch name
id: extract_branch
run: echo "value=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Run pre-release
uses: grails/github-actions/pre-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
RELEASE_URL: "https://api.github.com/repos/grails/gorm-docs/releases/${{ steps.create_release.outputs.id }}"
RELEASE_VERSION: ${{ github.event.inputs.gorm_version }}
- name: Publish Documentation
uses: gradle/gradle-build-action@v2
with:
arguments: asciidoctor groovydoc docs assemble
env:
TAGGED_VERSION: v${{ github.event.inputs.gorm_version }}
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: Create Release With Assets
uses: ncipollo/release-action@v1
id: create_release
if: success()
with:
tag: v${{ github.event.inputs.gorm_version }}
name: ${{ github.event.inputs.gorm_version }}
prerelease: ${{ env.BETA }}
artifacts: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.gorm_version }}.zip
artifactContentType: application/zip
generateReleaseNotes: true
token: ${{ secrets.GITHUB_TOKEN }}
env:
PATH_PREFIX: "./build/distributions/gorm-docs"
- name: Determine docs target repository
if: success()
uses: haya14busa/action-cond@v1
id: docs_target
with:
cond: ${{ github.repository == 'grails/gorm-docs' }}
if_true: 'grails/grails-data-mapping'
if_false: ${{ github.repository }}
- name: Publish to Github Pages
if: success()
uses: micronaut-projects/github-pages-deploy-action@master
env:
TARGET_REPOSITORY: ${{ steps.docs_target.outputs.value }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: build/docs
VERSION: ${{ github.event.inputs.gorm_version }}
DOC_FOLDER: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
- name: Run post-release
if: success()
uses: grails/github-actions/post-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
env:
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
RELEASE_VERSION: ${{ github.event.inputs.gorm_version }}
RELEASE_URL: "https://api.github.com/repos/grails/gorm-docs/releases/${{ steps.create_release.outputs.id }}"
SNAPSHOT_SUFFIX: -SNAPSHOT