Repository navigation
163 lines (155 loc) · 5.09 KB
/
Copy pathrelease.yml
File metadata and controls
163 lines (155 loc) · 5.09 KB
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
name: Release Elemento
on:
push:
tags:
- 'v*'
permissions:
contents: write
pages: write
id-token: write
jobs:
deploy-bom:
name: Deploy BOM
runs-on: ubuntu-latest
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN package
working-directory: bom
- uses: actions/setup-java@v6
with: # running setup-java again overwrites the settings.xml
java-version: 25
distribution: temurin
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- run: $MVN deploy -P release
working-directory: bom
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
deploy-elemento:
name: Deploy Maven Artifacts
runs-on: ubuntu-latest
needs: deploy-bom
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN package
- uses: actions/setup-java@v6
with: # running setup-java again overwrites the settings.xml
java-version: 25
distribution: temurin
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- run: $MVN deploy -P release
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: deploy-elemento
steps:
- name: Get Version
id: get-version
uses: battila7/get-version-action@v2.3.0
- uses: actions/checkout@v7
- name: Read Changelog
id: read-changelog
uses: mindsers/changelog-reader-action@v2
with:
path: ./CHANGELOG.md
version: ${{ steps.get-version.outputs.version-without-v }}
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-version.outputs.version }}
release_name: Elemento ${{ steps.get-version.outputs.version-without-v }}
body: ${{ steps.read-changelog.outputs.changes }}
draft: false
prerelease: false
publish-apidocs:
name: Build API Documentation
runs-on: ubuntu-latest
needs: release
env:
MVN: ./mvnw --show-version --batch-mode --no-transfer-progress
steps:
- uses: ts-graphviz/setup-graphviz@v2
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN install
working-directory: bom
- run: $MVN install -Dquickly
- run: $MVN depgraph:aggregate
- run: |
$MVN org.apache.maven.plugins:maven-antrun-plugin:run@copy-doc-files
$MVN org.apache.maven.plugins:maven-antrun-plugin:run@copy-sources
$MVN org.apache.maven.plugins:maven-antrun-plugin:run@copy-demos
$MVN javadoc:javadoc
working-directory: apidoc
- name: Upload apidocs to release
env:
GH_TOKEN: ${{ github.token }}
run: |
cd apidoc/target/reports/apidocs
zip -rq /tmp/apidocs.zip .
gh release upload "${{ github.ref_name }}" /tmp/apidocs.zip --clobber
publish-samples:
name: Build Samples
runs-on: ubuntu-latest
needs: release
env:
MVN: ./mvnw --show-version --batch-mode
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v6
with:
java-version: 25
distribution: temurin
cache: maven
- run: $MVN install
working-directory: bom
- run: $MVN install
- run: $MVN -f samples/pom.xml -Denvironment.base=/elemento/samples/music -P prod install
- name: Upload samples to release
env:
GH_TOKEN: ${{ github.token }}
run: |
cd samples/dist/target/samples
zip -rq /tmp/samples.zip .
gh release upload "${{ github.ref_name }}" /tmp/samples.zip --clobber
deploy-docs:
name: Deploy Documentation
runs-on: ubuntu-latest
needs: [publish-apidocs, publish-samples]
steps:
- name: Trigger site deployment on main
env:
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
run: gh workflow run site.yml --repo ${{ github.repository }} --ref main