File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ name : build-and-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+ container :
13+ image : gradle:8-jdk21
14+
15+ steps :
16+ - uses : actions/checkout@v4
17+
18+ - name : Tag Version Name Extraction
19+ id : version
20+ shell : bash
21+ run : |
22+ if [[ -n "${{ github.event.release.tag_name }}" ]]; then
23+ # Relase Github
24+ TAG_NAME="${{ github.event.release.tag_name }}"
25+ echo "📋 Triggered by GitHub release: $TAG_NAME"
26+ else
27+ # Just a new tag
28+ TAG_NAME=${GITHUB_REF#refs/tags/}
29+ echo "🏷️ Triggered by Git tag: $TAG_NAME"
30+ fi
31+
32+ # Get rid of the 'v', e.g. v8.18.1.0 -> 8.18.1.0
33+ VERSION=${TAG_NAME#v}
34+ echo "version=$VERSION" >> $GITHUB_OUTPUT
35+
36+
37+ - name : Java Compilation
38+ run : ./gradlew -Pplugin_version=${{ steps.version.outputs.version }} clean assemble --no-daemon
39+
40+ - name : Upload Plugin Artifact
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : elasticsearch-plugin-geoshape-${{ steps.version.outputs.version }}
44+ path : build/distributions/*.zip
45+
46+ - name : Attach ZIP to GitHub Release
47+ uses : softprops/action-gh-release@v2
48+ if : github.event.release.tag_name != ''
49+ with :
50+ files : build/distributions/elasticsearch-plugin-geoshape-${{ steps.version.outputs.version }}.zip
51+ tag_name : ${{ github.event.release.tag_name }}
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments