2020-04-30 00:30:15 +02:00
|
|
|
# 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
|
|
|
|
|
2020-05-02 01:27:24 +02:00
|
|
|
name: Maven build and deploy on release
|
2020-04-30 00:30:15 +02:00
|
|
|
|
|
|
|
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: |
|
2020-05-02 01:27:24 +02:00
|
|
|
mvn -B install package --file pom.xml
|
2020-04-30 00:30:15 +02:00
|
|
|
cp Minepacks/target/M*.jar artifacts/
|
|
|
|
|
2020-05-02 01:27:24 +02:00
|
|
|
- name: Publish to GitHub Packages Apache Maven
|
|
|
|
run: 'mvn deploy -pl Minepacks-API,Minepacks -s $GITHUB_WORKSPACE/settings.xml "-DaltDeploymentRepository=github::default::https://maven.pkg.github.com/GeorgH93/Minepacks"'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
2020-04-30 00:30:15 +02:00
|
|
|
|
|
|
|
- name: Build with Maven (Standalone)
|
|
|
|
run: |
|
|
|
|
mvn -B clean install package --file pom.xml -P Standalone,ExcludeBadRabbit
|
2020-05-02 01:27:24 +02:00
|
|
|
mv Minepacks/target/M*-Standalone.jar artifacts/
|
2020-04-30 00:30:15 +02:00
|
|
|
|
|
|
|
- name: Build with Maven (Release)
|
|
|
|
run: |
|
2020-05-02 01:27:24 +02:00
|
|
|
mvn -B clean package --file pom.xml -P Release
|
|
|
|
mv Minepacks/target/M*-Release.jar artifacts/
|
2020-04-30 00:30:15 +02:00
|
|
|
|
|
|
|
- name: Upload the artifacts
|
|
|
|
uses: skx/github-action-publish-binaries@master
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
args: 'artifacts/M*'
|