-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.67 KB
/
Copy pathrelease.yml
File metadata and controls
58 lines (48 loc) · 1.67 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
name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-upload:
name: Build and upload release artifacts
runs-on: ubuntu-latest
steps:
- name: Check out the released tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: gradle
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: '9.7.1'
- name: Build release artifacts
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
RELEASE_VERSION="${RELEASE_TAG#v}"
gradle clean build --no-daemon -PreleaseVersion="$RELEASE_VERSION"
- name: Create checksums
run: sha256sum build/libs/*.jar > build/libs/SHA256SUMS
- name: Attach artifacts to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
gh release upload "$RELEASE_TAG" build/libs/*.jar build/libs/SHA256SUMS --clobber
- name: Request JitPack build
continue-on-error: true
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
# JitPack builds Git tags on demand. Requesting the build log starts
# the build and avoids the obsolete /build endpoint (HTTP 404).
curl --fail --silent --show-error --retry 3 --retry-delay 5 \
"https://jitpack.io/com/github/${GITHUB_REPOSITORY}/${RELEASE_TAG}/build.log"