-
Notifications
You must be signed in to change notification settings - Fork 4
90 lines (90 loc) · 3.49 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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: grails-build
GIT_USER_EMAIL: grails-build@users.noreply.github.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: 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@v2
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: grails/github-pages-deploy-action@main
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@v2
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