Skip to content

feat : use tagVersion in release #2

feat : use tagVersion in release

feat : use tagVersion in release #2

Workflow file for this run

name: PickSpawner CD - Java 17 with Kotlin
on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Get the tag version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Install spigot nms dependencies
run: bash ./install-dependency-in-cache.sh
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build -PbuildVersion=1.18.2 -DtagVersion=${{ steps.get_version.outputs.VERSION }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Jar
id: upload-release-jar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/PickSpawner.jar
asset_name: PickSpawner-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/java-archive