From 2494d9ab45e3942da6822307481ec17cca738616 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Wed, 24 Apr 2024 19:37:19 -0400 Subject: [PATCH] Add demo plugin publish workflow --- .gitea/workflows/deploy-demo-plugin.yml | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitea/workflows/deploy-demo-plugin.yml diff --git a/.gitea/workflows/deploy-demo-plugin.yml b/.gitea/workflows/deploy-demo-plugin.yml new file mode 100644 index 0000000..27fb4ee --- /dev/null +++ b/.gitea/workflows/deploy-demo-plugin.yml @@ -0,0 +1,46 @@ +name: Deploy Demo Plugin + +on: + push: + branches: ["master"] + paths: [".gitea/workflows/deploy-demo-plugin.yml", "DemoSpigotPlugin/**", "!DemoSpigotPlugin/README.md"] + +jobs: + docker: + strategy: + matrix: + java-version: ["17"] + maven-version: ["3.8.5"] + runs-on: "ubuntu-latest" + defaults: + run: + working-directory: "./DemoSpigotPlugin" + + # Steps to run + steps: + # Checkout the repo + - name: Checkout + uses: actions/checkout@v4 + + # Setup Java and Maven + - name: Set up JDK and Maven + uses: s4u/setup-maven-action@v1.12.0 + with: + java-version: ${{ matrix.java-version }} + distribution: "zulu" + maven-version: ${{ matrix.maven-version }} + + # Build and package the jar + - name: Build Jar + run: mvn clean package -q -T4C + + # TODO: upload jar via ftp + - name: Upload Jar + run: echo "Upload jar to FTP" + + - name: Restart Remote Server + uses: hwalker928/ptero-gitsync@v1.0 + with: + panel-url: ${{ secrets.PTERO_URL }} + api-key: ${{ secrets.PTERO_API_KEY }} + server-id: ${{ secrets.DEMO_SERVER_ID }} \ No newline at end of file