Skip to content

Release

Release #67

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
strategy:
matrix:
java: ['11']
env:
BETA: ${{ contains(github.event.inputs.gorm_version, 'M') || contains(github.event.inputs.gorm_version, 'RC') }}
GIT_USER_NAME: puneetbehl
GIT_USER_EMAIL: behlp@objectcomputing.com
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: ${{ matrix.java }}
- 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.gorm_version }}.zip
if_false: ${{ env.PATH_PREFIX }}-${{ github.event.inputs.gorm_version }}.zip
env:
PATH_PREFIX: "./build/distributions/gorm-docs"
- 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.gorm_version }}
release_name: ${{ github.event.inputs.gorm_version }}
draft: false
prerelease: ${{ env.BETA }}
- name: Run pre-release
if: success() && github.event_name == 'workflow_dispatch'
uses: grails/github-actions/pre-release@main
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: 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: gorm-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/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@main
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 }}"
SNAPSHOT_SUFFIX: -SNAPSHOT