-
Notifications
You must be signed in to change notification settings - Fork 11
211 lines (211 loc) · 8.31 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Publish package to the Maven Central Repository
on:
push:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
outputs:
cacheKey: ${{ steps.cacheKey.outputs.cacheKey }}
steps:
- run: echo "CACHE_KEY=maven-de-tschuehly-$(date +%s)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
thymeleaf/build.gradle.kts
core/build.gradle.kts
jte/jte/build.gradle.kts
jte/jte-compiler/build.gradle.kts
jte/kte/build.gradle.kts
- name: make gradle executable
run: chmod +x ./gradlew
- name: publishToMavenLocal
run: ./gradlew :thymeleaf:publishToMavenLocal :jte-compiler:publishToMavenLocal :jte:publishToMavenLocal :core:publishToMavenLocal :kte:publishToMavenLocal
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ env.CACHE_KEY }}
- id: cacheKey
run: echo "cacheKey=${{ env.CACHE_KEY }}" >> $GITHUB_OUTPUT
test-thymeleaf-kotlin:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/thymeleaf-kotlin-example/build.gradle.kts
- name: run thymeleaf kotlin tests
run: |
cd ./examples
chmod +x ./gradlew
./gradlew thymeleaf-kotlin-example:test
test-thymeleaf-java:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/thymeleaf-java-example/build.gradle.kts
- name: run thymeleaf java tests
run: |
cd ./examples
chmod +x ./mvnw
./mvnw -f thymeleaf-java-example test
test-jte:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/jte-example/build.gradle.kts
- name: run jte java tests
run: |
cd ./examples/
chmod +x ./gradlew
./gradlew jte-example:test
chmod +x ./mvnw
./mvnw -f jte-example test
test-kte:
needs: build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
examples/kte-example/build.gradle.kts
- name: run kte kotlin tests
run: |
cd ./examples
chmod +x ./gradlew
./gradlew kte-example:test
publish:
needs: [build, test-jte, test-kte, test-thymeleaf-kotlin, test-thymeleaf-java]
if: github.ref_type == 'tag' || contains(github.ref_name, 'SNAPSHOT')
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cacheKey }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
cache-dependency-path: |
thymeleaf/build.gradle.kts
core/build.gradle.kts
jte/jte/build.gradle.kts
jte/jte-compiler/build.gradle.kts
jte/kte/build.gradle.kts
- name: Run chmod to make gradlew executable
run: chmod +x ./gradlew
- name: Publish thymeleaf package to staging
run: ./gradlew :thymeleaf:publish
- name: Publish thymeleaf package to maven central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :thymeleaf:jreleaserDeploy -DaltDeploymentRepository=local::file:./thymeleaf/build/staging-deploy --stacktrace
- name: Publish jte package to staging
run: ./gradlew :jte:publish
- name: Publish jte package to maven central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :jte:jreleaserDeploy -DaltDeploymentRepository=local::file:./jte/jte/build/staging-deploy --stacktrace
- name: Publish kte package to staging
run: ./gradlew :kte:publish
- name: Publish kte package to maven central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :kte:jreleaserDeploy -DaltDeploymentRepository=local::file:./jte/kte/build/staging-deploy --stacktrace
- name: Publish jte-compiler package to staging
run: ./gradlew :jte-compiler:publish
- name: Publish jte package to maven central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :jte-compiler:jreleaserDeploy -DaltDeploymentRepository=local::file:./jte/jte-compiler/build/staging-deploy --stacktrace
- name: Publish core package to staging
run: ./gradlew :core:publish
- name: Publish core package to maven central
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :core:jreleaserDeploy -DaltDeploymentRepository=local::file:./core/build/staging-deploy --stacktrace