Skip to content

Merge branch '1.21.4' #8

Merge branch '1.21.4'

Merge branch '1.21.4' #8

Workflow file for this run

name: Build and Publish Release
on:
push:
# Tag triggers releases, push triggers pre-releases
branches: [ master, main ]
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
# build
- name: Build with Gradle Wrapper
run: ./gradlew assemble
- name: Get version & release name
id: version
run: |
echo "version=$(./gradlew -q echoVersion)" >> $GITHUB_OUTPUT
echo "releaseName=$(./gradlew -q echoReleaseName)" >> $GITHUB_OUTPUT
- name: Print version & release name
run: |
echo "Version: ${{ steps.version.outputs.version }}"
echo "Release Name: ${{ steps.version.outputs.releaseName }}"
- name: Create an empty CHANGELOG.md if missing
run: |
if [ ! -f CHANGELOG.md ]; then
touch CHANGELOG.md
fi
- name: Create Release
id: createRelease
uses: ncipollo/[email protected]
with:
allowUpdates: true
updateOnlyUnreleased: true
artifacts: Underilla-Spigot/build/libs/Underilla-Spigot-${{ steps.version.outputs.version }}.jar
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.releaseName }}
bodyFile: CHANGELOG.md
prerelease: ${{ !startsWith(github.ref, 'refs/tags/') }}
skipIfReleaseExists: true