-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (105 loc) · 3.81 KB
/
release.yml
File metadata and controls
125 lines (105 loc) · 3.81 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
name: Release
on:
push:
tags:
- 'v*' # Only triggers on version tags like v1.2.0.
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Java 21 and Maven Central credentials
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
server-id: 'central'
server-username: ${{ secrets.CENTRAL_USERNAME }}
server-password: ${{ secrets.CENTRAL_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Import GPG key manually
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --yes --import
gpg --list-keys
- name: Set GPG_TTY for batch mode
run: echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
- name: Configure Maven settings.xml
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>central</id>
<username>${{ secrets.CENTRAL_USERNAME }}</username>
<password>${{ secrets.CENTRAL_PASSWORD }}</password>
</server>
</servers>
</settings>
EOF
env:
CENTRAL_USER_TOKEN: ${{ secrets.CENTRAL_USER_TOKEN }}
- name: Publish all modules to Maven Central
run: mvn clean deploy -Prelease -Dgpg.passphrase="${GPG_PASSPHRASE}" -DskipTests -B
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Set package version from tag
run: |
npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version --allow-same-version
sed -i "s/const VERSION = '.*'/const VERSION = '${{ steps.version.outputs.VERSION }}'/" storm.mjs
working-directory: storm-cli
- name: Publish to npm
run: npm publish --access public
working-directory: storm-cli
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
version-docs:
runs-on: ubuntu-latest
needs: publish
permissions:
contents: write
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.RELEASE_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: website/package-lock.json
- name: Install website dependencies
run: npm ci
working-directory: website
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Create docs version
run: npx docusaurus docs:version ${{ steps.version.outputs.VERSION }}
working-directory: website
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "docs: snapshot version ${{ steps.version.outputs.VERSION }}"
git push