Skip to content

Click detection fixes #3

Click detection fixes

Click detection fixes #3

name: Build and Release
on:
push:
branches:
- 'master'
paths:
- 'pom.xml'
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
MAVEN_OPTS: "-Dmaven.repo.local=./.m2/repository"
RELEASE_TAG: "Unknown"
steps:
- name: Checkout code
uses: actions/checkout@v3
# - name: Cache for Maven dependencies
# uses: actions/cache@v3
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-maven-
#
# - name: Extract version from pom.xml
# id: extract-version
# run: echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
#
# - name: Set RELEASE_TAG in env
# run: echo "RELEASE_TAG=${{ steps.extract-version.outputs.version }}" >> $GITHUB_ENV
#
# - name: Set up JDK 8
# uses: actions/setup-java@v3
# with:
# distribution: corretto
# java-version: 8
#
# - name: Build with Maven
# run: mvn -B package --file pom.xml
#
# - name: Start Spigot Server
# run: |
# curl -o spigot.jar https://cdn.getbukkit.org/spigot/spigot-1.16.5.jar
# java -jar spigot.jar
#
# - name: Accept EULA
# run: |
# echo "eula=true" > eula.txt
#
# - name: Disable End and Nether
# run: |
# echo "allow-nether=false" > server.properties
# echo "settings:" > bukkit.yml
# echo " allow-end: false" > bukkit.yml
#
# - name: Move jar file
# run: |
# mkdir plugins
# mv decent-holograms-plugin/target/DecentHolograms-${{ env.RELEASE_TAG }}.jar plugins/DecentHolograms-${{ env.RELEASE_TAG }}.jar
#
# - name: Execute Minecraft Commands
# run: |
# screen -S minecraft -d -m -L java -Xmx2G -jar spigot.jar nogui
# sleep 35
# screen -r minecraft -X stuff "dh$(printf \\r)"
# screen -r minecraft -X stuff "dh test$(printf \\r)"
# if screen -list | grep -q "minecraft"; then
# screen -S minecraft -X stuff "stop^M"
# sleep 10s
# fi
# while pgrep -u $USER -f "java -Xmx2G -jar spigot.jar nogui" > /dev/null; do sleep 1; done
# cat screenlog.0
# screen -r minecraft -X quit || true
#
# - name: Create Github release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.RELEASE_TAG }}
# release_name: DecentHolograms ${{ env.RELEASE_TAG }}
# draft: false
# prerelease: false
# asset_path: "target/DecentHolograms-${{ env.RELEASE_TAG }}.jar"
#
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: DecentHolograms-${{ env.RELEASE_TAG }}
# path: target/DecentHolograms-${{ env.RELEASE_TAG }}.jar
#
# - name: Publish Release to JitPack
# uses: jitpack-io/release-upload-action@v1
# with:
# api_token: ${{ secrets.JITPACK_API_TOKEN }}
# release_tag: ${{ env.RELEASE_TAG }}
# group_id: eu.decentsoftware.holograms
# artifact_id: decent-holograms-api
# file: ${{ github.workspace }}/target/DecentHolograms-${{ env.RELEASE_TAG }}.jar
# artifact: DecentHolograms-${{ env.RELEASE_TAG }}