-
Notifications
You must be signed in to change notification settings - Fork 24
120 lines (116 loc) · 3.54 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
name: Release Elemento
on:
push:
tags:
- 'v*'
jobs:
deploy:
name: Deploy Maven Artifacts
runs-on: ubuntu-latest
env:
MVN: ./mvnw --show-version --batch-mode
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Set up JDK
id: setup-jdk
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
cache: maven
- name: Package
id: package
run: $MVN package
- name: Set up Maven Settings
id: setup-maven-settings
uses: actions/setup-java@v4
with: # running setup-java again overwrites the settings.xml
java-version: 11
distribution: temurin
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Deploy
id: deploy
run: $MVN deploy -P release
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
publish:
name: Publish
runs-on: ubuntu-latest
env:
MVN: ./mvnw --show-version --batch-mode
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Set up JDK
id: setup-jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: maven
- name: Install
id: install
run: $MVN -D quickly install
- name: Build API Documentation
id: build-api-docs
run: |
$MVN -D quickly clean install
$MVN -P snippets javadoc:aggregate
$MVN -P snippets javadoc:javadoc
$MVN -P snippets org.apache.maven.plugins:maven-antrun-plugin:run@copy-apidocs
- name: Publish API Documentation
id: publish-api-docs
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
branch: gh-pages
folder: ./target/site/apidocs
target-folder: apidocs
clean: true
- name: Build Samples
id: build-samples
run: $MVN --projects org.jboss.elemento:elemento-samples-dist --also-make -P samples,prod install
- name: Publish Samples
id: publish-samples
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
branch: gh-pages
folder: ./samples/dist/target/samples
target-folder: samples
clean: true
release:
name: Create GitHub Release
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Get Version
id: get-version
uses: battila7/get-version-action@v2.3.0
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Read Changelog
id: read-changelog
uses: mindsers/changelog-reader-action@v2
with:
path: ./CHANGELOG.md
version: ${{ steps.get-version.outputs.version-without-v }}
- name: Create GitHub Release
id: create-gh-release
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