-
Notifications
You must be signed in to change notification settings - Fork 535
95 lines (95 loc) · 3.87 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
91
92
93
94
95
name: Release
on:
workflow_dispatch:
inputs:
grails_version:
description: 'Grails Version (eg: 4.0.6)'
required: true
jobs:
release:
runs-on: ubuntu-latest
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: [email protected]
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v2
- uses: actions/setup-java@v4
with: { java-version: 17, distribution: temurin }
- 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
env:
PATH_PREFIX: "./build/distributions/grails-docs"
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
- name: Tag and Release Docs
uses: ./.github/actions/tag-and-release
if: success() && github.event_name == 'workflow_dispatch'
env:
TARGET_BRANCH: ${{ steps.extract_branch.outputs.value }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
grails_version: ${{ github.event.inputs.grails_version }}
- 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/actions/setup-gradle@v3
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 }}
with:
arguments: |
assemble
-PgithubBranch=${{ steps.extract_branch.outputs.value }}
--info
--stacktrace
- 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: Publish to Github Pages
if: success()
uses: grails/github-pages-deploy-action@v2
env:
BRANCH: gh-pages
COMMIT_EMAIL: ${{ env.GIT_USER_EMAIL }}
COMMIT_NAME: ${{ env.GIT_USER_NAME }}
FOLDER: build/docs
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TARGET_REPOSITORY: ${{ github.repository }}
VERSION: ${{ github.event.inputs.grails_version }}