Bump version to v2.2.1 for release #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Package | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| release: | |
| name: Build and Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PACKAGES_USER: ${{ secrets.HAUNTEDMC_PACKAGES_USERNAME }} | |
| PACKAGES_TOKEN: ${{ secrets.HAUNTEDMC_PACKAGES_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate package token | |
| run: | | |
| if [ -z "$PACKAGES_USER" ]; then | |
| echo "Missing secret HAUNTEDMC_PACKAGES_USERNAME." >&2 | |
| exit 1 | |
| fi | |
| if [ -z "$PACKAGES_TOKEN" ]; then | |
| echo "Missing secret HAUNTEDMC_PACKAGES_TOKEN (requires read:packages and write:packages)." >&2 | |
| exit 1 | |
| fi | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "21" | |
| cache: maven | |
| server-id: github | |
| server-username: PACKAGES_USER | |
| server-password: PACKAGES_TOKEN | |
| - name: Build with Maven | |
| run: mvn -U -B -ntp package | |
| - name: Resolve artifact name | |
| run: echo "TARGET_NAME=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.build.finalName)" >> "$GITHUB_ENV" | |
| - name: Upload distributable | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: target/${{ env.TARGET_NAME }}.jar | |
| - name: Publish to GitHub Packages (Maven) | |
| run: mvn -U -B -ntp deploy | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ServerFeatures ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: target/${{ env.TARGET_NAME }}.jar |