File tree Expand file tree Collapse file tree 2 files changed +61
-2
lines changed Expand file tree Collapse file tree 2 files changed +61
-2
lines changed Original file line number Diff line number Diff line change 1
- name : Build
1
+ name : compile-and-test
2
2
3
3
on :
4
4
pull_request :
13
13
uses : actions/setup-java@v4
14
14
with :
15
15
distribution : ' temurin'
16
- java-version : 17
16
+ java-version : 21
17
17
- name : Setup Gradle
18
18
uses : gradle/actions/setup-gradle@v4
19
19
- name : Build with Gradle
Original file line number Diff line number Diff line change
1
+ name : publish
2
+
3
+ on :
4
+ push :
5
+ tags : ['v*']
6
+ release :
7
+ types : [published]
8
+
9
+ jobs :
10
+ build-artifact :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+
16
+ - name : Tag Version Name Extraction
17
+ id : version
18
+ shell : bash
19
+ run : |
20
+ if [[ -n "${{ github.event.release.tag_name }}" ]]; then
21
+ # Relase Github
22
+ TAG_NAME="${{ github.event.release.tag_name }}"
23
+ echo "📋 Triggered by GitHub release: $TAG_NAME"
24
+ else
25
+ # Just a new tag
26
+ TAG_NAME=${GITHUB_REF#refs/tags/}
27
+ echo "🏷️ Triggered by Git tag: $TAG_NAME"
28
+ fi
29
+
30
+ # Get rid of the 'v', e.g. v8.18.1.0 -> 8.18.1.0
31
+ VERSION=${TAG_NAME#v}
32
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
33
+
34
+ - name : Setup Java
35
+ uses : actions/setup-java@v4
36
+ with :
37
+ distribution : ' temurin'
38
+ java-version : 21
39
+
40
+ - name : Setup Gradle
41
+ uses : gradle/actions/setup-gradle@v4
42
+
43
+ - name : Java Compilation
44
+ run : ./gradlew -Pplugin_version=${{ steps.version.outputs.version }} clean assemble --no-daemon
45
+
46
+ - name : Upload Plugin Artifact
47
+ uses : actions/upload-artifact@v4
48
+ with :
49
+ name : pathhierarchy-aggregation-${{ steps.version.outputs.version }}
50
+ path : build/distributions/*.zip
51
+
52
+ - name : Attach ZIP to GitHub Release
53
+ uses : softprops/action-gh-release@v2
54
+ if : github.event.release.tag_name != ''
55
+ with :
56
+ files : build/distributions/pathhierarchy-aggregation-${{ steps.version.outputs.version }}.zip
57
+ tag_name : ${{ github.event.release.tag_name }}
58
+ env :
59
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments