-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.96 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (54 loc) · 1.96 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: read
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Verify gradle version matches tag
run: |
gradle_version=$(grep -oP 'version\s*=\s*"\K[^"]+' client/build.gradle.kts)
if [ "$gradle_version" != "${{ steps.version.outputs.version }}" ]; then
echo "Version mismatch: tag=${{ steps.version.outputs.version }}, gradle=$gradle_version" >&2
exit 1
fi
- name: Build + obfuscate jar
run: ./gradlew :client:proguardJar --no-daemon --stacktrace
- name: Stage release artifact + checksum
id: artifact
run: |
version="${{ steps.version.outputs.version }}"
src="client/build/libs/void-client-${version}-release.jar"
dst_dir="release"
dst="${dst_dir}/void-client-${version}.jar"
mkdir -p "$dst_dir"
cp "$src" "$dst"
(cd "$dst_dir" && sha256sum "void-client-${version}.jar" > "void-client-${version}.jar.sha256")
echo "jar=$dst" >> "$GITHUB_OUTPUT"
echo "sha=${dst}.sha256" >> "$GITHUB_OUTPUT"
- name: Publish release to public repo
env:
GH_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: |
gh release create "${{ github.ref_name }}" \
--repo 2011Scape/void-client-releases \
--title "${{ github.ref_name }}" \
--notes-file "release-notes/${{ github.ref_name }}.md" \
"${{ steps.artifact.outputs.jar }}" \
"${{ steps.artifact.outputs.sha }}"