Skip to content

Add releasing github actions (#29) #1

Add releasing github actions (#29)

Add releasing github actions (#29) #1

name: Release Snapshot
on:
push:
branches: [ master ]
jobs:
release-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Build with Gradle
run: ./gradlew buildPlugin
- name: Get plugin version
id: get_version
run: echo "VERSION=$(grep 'version =' build.gradle.kts | head -n 1 | cut -d '"' -f 2)-SNAPSHOT" >> $GITHUB_OUTPUT
- name: Get commit hash
id: get_commit
run: echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: snapshot-${{ steps.get_commit.outputs.COMMIT }}
name: Snapshot ${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit.outputs.COMMIT }}
body: |
Automated snapshot build from commit ${{ steps.get_commit.outputs.COMMIT }}
This is an automated snapshot release created from the latest commit to the master branch.
files: build/libs/*.jar
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}