-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (59 loc) · 2.34 KB
/
release.yaml
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
name: Release
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
# configuration of settings.xml
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
# don't use setup-java cache - hash file pattern has issues
- name: Cache - restore local Maven repository
id: cache-restore
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: release-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: release-${{ runner.os }}-maven-
- name: set github user
run: |
git config --global user.name "jnotebook-ci"
git config --global user.email "jnotebook-ci@users.noreply.github.com"
- name: create release
run: |
./mvnw -B -V -ntp -Prelease release:clean initialize release:prepare release:perform
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- uses: browser-actions/setup-chrome@v1
- name: generate doc
id: generate_doc
run: |
distribution=jnotebook-distribution/target/$(ls ./jnotebook-distribution/target/ | grep -E -i '^jnotebook-distribution-[0-9]+\.[0-9]+\.[0-9]+\.jar$')
./$distribution render -cp="" doc/book.jsh index.html
git add index.html
git stash
git fetch
git checkout website
git checkout stash -- index.html
git commit --allow-empty -m "update doc"
git push
- name: Cache - save local Maven repository
uses: actions/cache/save@v3
# save to cache only if necessary + cache even if tests failed (useful if flakiness)
if: steps.cache-restore.outputs.cache-hit != 'true' && ( failure() || success())
with:
path: ~/.m2/repository
key: release-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}