Fixes 'already occupied' message when switching seats to the current one #517
Workflow file for this run
This file contains 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
# This workflow will build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Build with Maven | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
# Compile the project | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Use Java 8 to compile old Spigot version | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 8 | |
distribution: temurin | |
cache: maven | |
- name: Compile Spigot 1.8 - 1.16.5 | |
uses: SpraxDev/Action-SpigotMC@v4 | |
with: | |
versions: 1.8, 1.8.3, 1.8.8, 1.9.2, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13, 1.13.2, 1.14.4, 1.15.2, 1.16.1, 1.16.3, 1.16.5 | |
# Use Java 16 for Spigot 1.17 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 16 | |
distribution: temurin | |
- name: Compile Spigot 1.17 | |
uses: SpraxDev/Action-SpigotMC@v4 | |
with: | |
versions: 1.17 | |
# Use Java 17 for everything else | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Compile Spigot versions | |
uses: SpraxDev/Action-SpigotMC@v4 | |
with: | |
versions: 1.18.1, 1.18.2 | |
- name: Compile Spigot versions (remapped) | |
uses: SpraxDev/Action-SpigotMC@v4 | |
with: | |
versions: 1.19, 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.20.2 | |
remapped: true | |
# Compile the project using maven | |
- name: Build with Maven | |
run: 'mvn -B -Duser.name="GitHub Runner on $GITHUB_REPOSITORY (id=$GITHUB_RUN_ID)" clean package' | |
# Upload the .jar file | |
- name: 'Upload Build Artifact: BetterChairs.jar' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: BetterChairs | |
path: ./modules/betterchairs-plugin/target/BetterChairs*.jar | |
# Run static code analysis | |
- name: 'SonarCloud.io (static code analysis)' | |
if: ${{ env.SONAR_TOKEN != null }} | |
run: 'mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
# Check if the versions inside `pom.xml`, CHANGELOG.md and `./docs/version.txt` | |
# match and that everything has been edited correctly when pushing a new release version | |
check-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Extract version from the pom.xml and compare to docs/version.txt | |
id: version_diff # Outputs 'same' or 'diff' | |
run: mkdir -p docs && echo $(grep --max-count=1 '<version>' pom.xml | awk -F '>' '{ print $2 }' | awk -F '<' '{ print $1 }') >> docs/version_new.txt && diff -q --ignore-space-change --strip-trailing-cr --ignore-blank-lines docs/version.txt docs/version_new.txt 2>&1 && echo "result=same" >> $GITHUB_OUTPUT || echo "result=diff" >> $GITHUB_OUTPUT | |
- name: Check if extracted version matches docs/version.txt | |
if: ${{ steps.version_diff.outputs.result != 'same' }} | |
uses: unsplash/comment-on-pr@master | |
with: | |
msg: "Versions in `pom.xml` and `docs/version.txt` are not the same! Please use the same version in both files." | |
check_for_duplicate_msg: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check if version from docs/version.txt is inside CHANGELOG.md | |
id: inside_changelog # Outputs 'yes' or 'no' | |
run: verTxt=$(cat docs/version.txt) && grep -q "## Version ${verTxt}" CHANGELOG.md && echo "result=yes" >> $GITHUB_OUTPUT || echo "result=no" >> $GITHUB_OUTPUT | |
- name: Check if extracted version matches docs/version.txt | |
if: ${{ steps.inside_changelog.outputs.result != 'yes' }} | |
uses: unsplash/comment-on-pr@master | |
with: | |
msg: "`CHANGELOG.md` is missing changes for version in `docs/version.txt`!" | |
check_for_duplicate_msg: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Fail Action when versions (from above) are not the same | |
if: ${{ steps.version_diff.outputs.result != 'same' }} | |
run: echo "The versions inside pom.xml and docs/version.txt are not the same!" && exit -1 | |
- name: Fail Action when docs/version.txt not inside CHANGELOG.md | |
if: ${{ steps.inside_changelog.outputs.result != 'yes' }} | |
run: echo "CHANGELOG.md is missing changes for version in docs/version.txt!" && exit -1 |