Skip to content

Commit 95cb906

Browse files
committed
Merge branch 'main' of github.com:ZetaPlugins/WYG
2 parents b569a15 + 2b84a63 commit 95cb906

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release on version change
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'build.gradle' # only run when build.gradle changes
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '21'
21+
distribution: 'temurin'
22+
23+
- name: Extract version from build.gradle
24+
id: get_version
25+
run: |
26+
VERSION=$(grep "^version" build.gradle | sed "s/version *= *['\"]//" | sed "s/['\"]//")
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
29+
- name: Cache Gradle
30+
uses: actions/cache@v4
31+
with:
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
36+
restore-keys: gradle-${{ runner.os }}-
37+
38+
- name: Build shadowJar
39+
run: ./gradlew shadowJar --no-daemon
40+
41+
- name: Upload build artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: plugin-jar
45+
path: build/libs/*.jar
46+
47+
- name: Create GitHub Release
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
tag_name: v${{ steps.get_version.outputs.version }}
51+
name: Release v${{ steps.get_version.outputs.version }}
52+
draft: false
53+
prerelease: false
54+
files: build/libs/*.jar
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)