Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven

- name: Build with Maven
run: mvn -B --no-transfer-progress package

- name: Upload JAR
uses: actions/upload-artifact@v4
with:
name: SMP-jar
path: target/*.jar
if-no-files-found: error
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
push:
tags: ['release-*']

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven

- name: Verify tag matches pom.xml version
run: |
POM_VERSION=$(mvn -B -q help:evaluate -Dexpression=project.version -DforceStdout)
TAG_VERSION="${GITHUB_REF_NAME#release-}"
echo "pom.xml version: $POM_VERSION"
echo "Tag version: $TAG_VERSION"
if [ "$POM_VERSION" != "$TAG_VERSION" ]; then
echo "::error::Tag '$GITHUB_REF_NAME' does not match pom.xml version '$POM_VERSION'"
exit 1
fi

- name: Build with Maven
run: mvn -B --no-transfer-progress package

- name: Publish Release
uses: softprops/action-gh-release@v2
with:
files: target/*.jar
generate_release_notes: true
fail_on_unmatched_files: true
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- PaperMC -->
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<!-- Plugin: CoreProtect -->
<repository>
Expand Down
Loading