-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (133 loc) · 5.05 KB
/
spring-artifactory-gradle-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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Perform Release with Gradle and Artifactory
on:
workflow_call:
inputs:
buildToolArgs:
description: 'Additional Gradle command arguments: tasks, options etc. The `build` and `artifactoryPublish` for Gradle are included.'
required: false
type: string
artifactoryUrl:
description: 'The Artifactory Server'
required: false
type: string
stagingRepository:
description: 'The Artifactory Repository to stage artifacts to'
required: false
type: string
default: libs-staging-local
targetMilestoneRepository:
description: 'The Artifactory Repository to promote the milestone build to'
required: false
type: string
default: libs-milestone-local
targetReleaseRepository:
description: 'The Artifactory Repository to promote the release build to'
required: false
type: string
default: libs-release-local
artifactoryProjectKey:
description: 'The Artifactory project key'
required: false
type: string
verifyStagedWorkflow:
description: 'A workflow name in the target project to dispatch against staged artifacts. The `releaseVersion` must be a workflow input.'
required: false
type: string
default: verify-staged-artifacts.yml
runner:
description: 'The runner for job'
required: false
type: string
default: ubuntu-latest
secrets:
DEVELOCITY_ACCESS_KEY:
required: false
SPRING_RELEASE_CHAT_WEBHOOK_URL:
required: false
GH_ACTIONS_REPO_TOKEN:
required: true
OSSRH_S01_TOKEN_USERNAME:
required: false
OSSRH_S01_TOKEN_PASSWORD:
required: false
OSSRH_STAGING_PROFILE_NAME:
required: false
GPG_PASSPHRASE:
required: false
GPG_PRIVATE_KEY:
required: false
JF_ARTIFACTORY_SPRING:
required: true
ARTIFACTORY_USERNAME:
required: true
ARTIFACTORY_PASSWORD:
required: true
jobs:
releaseVersion:
uses: ./.github/workflows/spring-find-release-version.yml
staging:
needs: releaseVersion
name: Stage ${{ needs.releaseVersion.outputs.releaseVersion }}
uses: ./.github/workflows/spring-artifactory-gradle-release-staging.yml
with:
releaseVersion: ${{ needs.releaseVersion.outputs.releaseVersion }}
gradleTasks: ${{ inputs.buildToolArgs }}
artifactoryUrl: ${{ inputs.artifactoryUrl }}
stagingRepository: ${{ inputs.stagingRepository }}
artifactoryProjectKey: ${{ inputs.artifactoryProjectKey }}
runner: ${{ inputs.runner }}
secrets: inherit
verify-staged:
needs: [releaseVersion, staging]
name: Verify ${{ needs.releaseVersion.outputs.releaseVersion }}
runs-on: ${{ inputs.runner }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Checkout Common Repo
uses: actions/checkout@v4
with:
repository: spring-io/spring-github-workflows
path: spring-github-workflows
show-progress: false
ref: ${{ env.WORKFLOWS_REF }}
- name: Dispatch Workflow
timeout-minutes: 30
uses: ./spring-github-workflows/.github/actions/spring-dispatch-workflow-and-wait
with:
workflow: ${{ inputs.verifyStagedWorkflow }}
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "releaseVersion": "${{ needs.releaseVersion.outputs.releaseVersion }}" }'
promote-milestone:
needs: [releaseVersion, staging, verify-staged]
name: Promote ${{ needs.releaseVersion.outputs.releaseVersion }}
if: ${{ (contains(needs.releaseVersion.outputs.releaseVersion, '-M') || contains(needs.releaseVersion.outputs.releaseVersion, '-RC')) }}
uses: ./.github/workflows/spring-artifactory-promote-milestone.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
targetRepository: ${{ inputs.targetMilestoneRepository }}
artifactoryProjectKey: ${{ inputs.artifactoryProjectKey }}
runner: ${{ inputs.runner }}
secrets: inherit
promote-ga:
needs: [releaseVersion, staging, verify-staged]
name: Promote ${{ needs.releaseVersion.outputs.releaseVersion }}
if: ${{ !contains(needs.releaseVersion.outputs.releaseVersion, '-') }}
uses: ./.github/workflows/spring-artifactory-promote-ga.yml
with:
buildName: ${{ needs.staging.outputs.buildName }}
buildNumber: ${{ needs.staging.outputs.buildNumber }}
targetRepository: ${{ inputs.targetReleaseRepository }}
artifactoryProjectKey: ${{ inputs.artifactoryProjectKey }}
runner: ${{ inputs.runner }}
secrets: inherit
finalize:
if: ${{ !(failure() || cancelled()) }}
needs: [releaseVersion, promote-milestone, promote-ga]
name: Finalize ${{ needs.releaseVersion.outputs.releaseVersion }}
uses: ./.github/workflows/spring-finalize-release.yml
with:
milestone: ${{ needs.releaseVersion.outputs.releaseVersion }}
secrets: inherit