-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (65 loc) · 2.47 KB
/
release-please.yml
File metadata and controls
79 lines (65 loc) · 2.47 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
name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
# Release type for Gradle/Java projects
release-type: simple
# Package name for the release
package-name: cerberus
# Bump minor version for features, patch for fixes
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
# Build and upload JAR artifact when a release is created
- name: Checkout code
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@v6
- name: Setup asdf and install tools
if: ${{ steps.release.outputs.release_created }}
uses: asdf-vm/actions/install@v4
- name: Setup Gradle
if: ${{ steps.release.outputs.release_created }}
uses: gradle/actions/setup-gradle@v6
- name: Build with Gradle
if: ${{ steps.release.outputs.release_created }}
run: ./gradlew clean build shadowJar -x spotbugsMain
- name: Generate checksums
if: ${{ steps.release.outputs.release_created }}
run: |
cd build/libs
sha256sum *-all.jar > checksums.txt
cat checksums.txt
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Find the generated shadow JAR (works regardless of version in build.gradle)
JAR_FILE=$(find build/libs -name "*-all.jar" -type f)
if [ -z "$JAR_FILE" ]; then
echo "Error: No shadow JAR found in build/libs"
exit 1
fi
echo "Found JAR: $JAR_FILE"
# Upload with a clean name using the tag
gh release upload ${{ steps.release.outputs.tag_name }} \
"$JAR_FILE#cerberus-${{ steps.release.outputs.tag_name }}.jar" \
--clobber
# Also upload with original filename for compatibility
gh release upload ${{ steps.release.outputs.tag_name }} \
"$JAR_FILE" \
--clobber
# Upload checksums
gh release upload ${{ steps.release.outputs.tag_name }} \
build/libs/checksums.txt \
--clobber