-
Notifications
You must be signed in to change notification settings - Fork 17
57 lines (49 loc) · 2.02 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (49 loc) · 2.02 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
name: Release
# Cut a release by pushing a CalVer tag (year.month.day), e.g.:
# git tag 2026.05.25 && git push origin 2026.05.25
# Second release on the same day: add a micro suffix -> 2026.05.25.1
# Pre-release (does not move "latest"): add a hyphen -> 2026.05.25-rc1
# See docs/RELEASING.md.
on:
push:
tags:
- '20[0-9][0-9].*' # matches 2026.05.25, 2026.05.25.1, 2026.05.25-rc1, ...
permissions:
contents: write # required for `gh release create`
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the tagged commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: temurin
java-version: '21'
cache: gradle
- name: Build extension JAR
# The tag is the version; it is baked into the JAR manifest. The artifact
# filename stays constant (web3-decoder.jar) regardless of version.
run: ./gradlew jar -PreleaseVersion="$GITHUB_REF_NAME" --no-daemon
- name: Stage a versioned copy of the JAR
run: cp web3-decoder/build/libs/web3-decoder.jar "web3-decoder-${GITHUB_REF_NAME}.jar"
- name: Determine release flag
# A hyphen in the tag (e.g. 2026.05.25-rc1) marks a pre-release that does
# not move the "latest" pointer; anything else is published as latest.
run: |
if [[ "$GITHUB_REF_NAME" == *-* ]]; then
echo "RELEASE_FLAG=--prerelease" >> "$GITHUB_ENV"
else
echo "RELEASE_FLAG=--latest" >> "$GITHUB_ENV"
fi
- name: Publish release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "$GITHUB_REF_NAME" \
"web3-decoder-${GITHUB_REF_NAME}.jar" \
web3-decoder/build/libs/web3-decoder.jar \
--title "Web3 Decoder $GITHUB_REF_NAME" \
--generate-notes \
$RELEASE_FLAG