-
Notifications
You must be signed in to change notification settings - Fork 134
166 lines (163 loc) · 8.28 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Release
run-name: "Release${{ inputs.module && inputs.version && format(' ({0} {1})', inputs.module, inputs.version) || (inputs.module && format(' ({0})', inputs.module)) || format(' (auto: {0})', github.ref_name) }}"
on:
release:
types:
- released
workflow_dispatch:
inputs:
module:
type: choice
description: Which module to release
options:
- From Tag
- core
- java-async-http
- java-dropwizard
- java-spring-mvc
- java-support
- scala-akka-http
- scala-dropwizard
- scala-http4s
- scala-support
- cli
version:
type: input
description: 'What version to use (default: derive from git)'
jobs:
publish:
name: 'Publish release'
runs-on: ubuntu-20.04
steps:
- name: 'Extract project from tag'
id: set-project-from-tag
run: |
module="${{ github.event.inputs.module }}"
if [ -z "$module" ] || [ "$module" = "From Tag" ]; then
module="$(echo "$GITHUB_REF" | sed 's~^refs/tags/\(.*\)-v[0-9.]\+$~\1~')"
echo "extract project: ${GITHUB_REF}, ${module}"
else
echo "Using supplied module: $module"
fi
echo "module=$module" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 14
- name: 'Print versions'
run: |
java -version
gpg --version
- name: 'Publish artifacts [core]'
if: ${{ steps.set-project-from-tag.outputs.module == 'core' }}
run: sbt 'show version' "project guardrail-core" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [java-async-http]'
if: ${{ steps.set-project-from-tag.outputs.module == 'java-async-http' }}
run: sbt 'show version' "project guardrail-java-async-http" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [java-dropwizard]'
if: ${{ steps.set-project-from-tag.outputs.module == 'java-dropwizard' }}
run: sbt 'show version' "project guardrail-java-dropwizard" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [java-spring-mvc]'
if: ${{ steps.set-project-from-tag.outputs.module == 'java-spring-mvc' }}
run: sbt 'show version' "project guardrail-java-spring-mvc" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [java-support]'
if: ${{ steps.set-project-from-tag.outputs.module == 'java-support' }}
run: sbt 'show version' "project guardrail-java-support" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [scala-akka-http]'
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-akka-http' }}
run: sbt 'show version' "project guardrail-scala-akka-http" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [scala-dropwizard]'
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-dropwizard' }}
run: sbt 'show version' "project guardrail-scala-dropwizard" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [scala-http4s]'
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-http4s' }}
run: sbt 'show version' "project guardrail-scala-http4s" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [scala-support]'
if: ${{ steps.set-project-from-tag.outputs.module == 'scala-support' }}
run: sbt 'show version' "project guardrail-scala-support" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Publish artifacts [cli]'
if: ${{ steps.set-project-from-tag.outputs.module == 'cli' }}
run: sbt 'show version' "project guardrail-cli" clean compile versionCheck test ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GUARDRAIL_RELEASE_MODULE: ${{ steps.set-project-from-tag.outputs.module }}
GUARDRAIL_RELEASE_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}