From 82e26228e007a5bded94e3e66bdf5cc9d625829f Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Thu, 30 Apr 2020 00:30:15 +0200 Subject: [PATCH] Add release workflow This workflow will build the plugin and add the artifacts to newly created releases --- .github/workflows/release.yml | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4dd19bd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +# This workflow will run every time a new release is created. +# It will first build the plugin using Maven, then publish it to GitHub packages and finally attach the artifacts to the release + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Setup workspace + run: mkdir artifacts + + - name: Build with Maven + run: | + mvn -B install package --file pom.xml -P ExcludeBadRabbit + cp Minepacks/target/M*.jar artifacts/ + + - name: Publish to GitHub Packages Apache Maven + run: 'mvn deploy -s $GITHUB_WORKSPACE/settings.xml "-DaltDeploymentRepository=github::default::https://maven.pkg.github.com/GeorgH93/Minepacks"' + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Build with Maven (Standalone) + run: | + mvn -B clean install package --file pom.xml -P Standalone,ExcludeBadRabbit + mv Minepacks/target/M*.jar artifacts/ + + - name: Build with Maven (Release) + run: | + mvn -B package --file pom.xml -P Release + mv Minepacks/target/M*.jar artifacts/ + + - name: Upload the artifacts + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: 'artifacts/M*'