-
Notifications
You must be signed in to change notification settings - Fork 14
81 lines (71 loc) · 2.2 KB
/
prepare_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
name: Prepare release and tag
run-name: Prepare release ${{ github.sha }} by @${{ github.actor }}
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
type: string
description: 'Release version'
required: false
next:
type: string
description: 'Next development version'
required: false
publish:
type: boolean
default: 'true'
description: 'Trigger publish workflow after tag'
jobs:
build:
runs-on: [ ubuntu-latest ]
permissions:
contents: write
pull-requests: write
actions: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CONDUKTORBOT_REPO_WRITE }}
- name: Setup GPG
id: gpg
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.CONDUKTOR_BOT_GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
server-id: github
- name: Maven release prepare
id: prepare
run: |
mvn --batch-mode release:prepare -DreleaseVersion=${{ inputs.version }} -DdevelopmentVersion=${{ inputs.next }} --file pom.xml
env:
GITHUB_TOKEN: ${{ secrets.CONDUKTORBOT_REPO_WRITE }}
- name: Read value from release properties
id: release_property
uses: christian-draeger/[email protected]
with:
path: 'release.properties'
properties: 'scm.tag'
- name: Start publish workflow
if: ${{ inputs.publish }}
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'conduktor',
repo: 'conduktor-gateway',
workflow_id: 'publish.yml',
ref: 'main',
inputs: {
from: `${{ steps.release_property.outputs.scm-tag }}`,
},
});