From cf64f32d35ffda011692eb24ce5d45551cc905ed Mon Sep 17 00:00:00 2001 From: Tad Hunt Date: Thu, 21 Sep 2023 10:41:46 -0600 Subject: [PATCH 1/4] add github action to build the plugin --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ pom.xml | 6 +++--- 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..5abbd70e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: build + +on: + workflow_dispatch: + push: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: 'Checkout source code' + uses: actions/checkout@v4 + - name: 'Set up JDK' + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + + - name: 'Cache dependencies' + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: 'Build, test, and package' + run: mvn -B package --file pom.xml + + - name: 'Get artifact version' + id: pomVersion + run: | + VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout ) + echo "::set-output name=version::$VERSION" + + - name: 'Upload artifact' + uses: actions/upload-artifact@v3 + with: + name: Cannons-${{ steps.pomVersion.outputs.version }}.jar + path: target/Cannons-${{ steps.pomVersion.outputs.version }}.jar diff --git a/pom.xml b/pom.xml index 232cd836..b5354a62 100644 --- a/pom.xml +++ b/pom.xml @@ -138,8 +138,8 @@ maven-compiler-plugin 3.8.0 - 1.8 - 1.8 + 17 + 17 @@ -168,7 +168,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.1.0 + 3.5.0 From 081db9efce7569379cf7564ff5bb99c141e7e91a Mon Sep 17 00:00:00 2001 From: Tad Hunt Date: Thu, 21 Sep 2023 10:48:31 -0600 Subject: [PATCH 2/4] Update README.md with build status badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 19f7bbfe..27dcc73a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ Cannons ======= +[![build](https://github.com/tadhunt/Cannons/actions/workflows/build.yml/badge.svg?branch=2.5.13-mcpd)](https://github.com/tadhunt/Cannons/actions/workflows/build.yml) by derPavlov From f6eed4bfe7da3b384c712fe0db1338098c0ee773 Mon Sep 17 00:00:00 2001 From: Tad Hunt Date: Thu, 21 Sep 2023 10:54:43 -0600 Subject: [PATCH 3/4] update workflow to remove deprecation warning --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5abbd70e..546cae7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: id: pomVersion run: | VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout ) - echo "::set-output name=version::$VERSION" + echo "version=${VERSION}" >> $GITHUB_OUTPUT - name: 'Upload artifact' uses: actions/upload-artifact@v3 From 66008b228c60943400364d760ee38b1a363efe09 Mon Sep 17 00:00:00 2001 From: Tad Hunt Date: Thu, 21 Sep 2023 12:05:09 -0600 Subject: [PATCH 4/4] update build status badge to track this branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 27dcc73a..6c8340d2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Cannons ======= -[![build](https://github.com/tadhunt/Cannons/actions/workflows/build.yml/badge.svg?branch=2.5.13-mcpd)](https://github.com/tadhunt/Cannons/actions/workflows/build.yml) +[![build](https://github.com/tadhunt/Cannons/actions/workflows/build.yml/badge.svg?branch=feature/github-actions)](https://github.com/tadhunt/Cannons/actions/workflows/build.yml) by derPavlov