mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-09 19:48:13 +01:00
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
# 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: Build and release
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 17
|
|
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 -s .github/workflows/settings.xml install --file pom.xml
|
|
cp Minepacks/target/M*.jar artifacts/
|
|
|
|
- name: Build with Maven (Standalone)
|
|
run: |
|
|
mvn -B -s .github/workflows/settings.xml clean install --file pom.xml -P Standalone,ExcludeBadRabbit
|
|
mv Minepacks/target/M*-Standalone.jar artifacts/
|
|
|
|
- name: Build with Maven (Release)
|
|
run: |
|
|
mvn -B -s .github/workflows/settings.xml clean package --file pom.xml -P Release
|
|
mv Minepacks/target/M*-Release.jar artifacts/
|
|
|
|
- name: Upload the artifacts
|
|
uses: skx/github-action-publish-binaries@master
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
args: 'artifacts/M*'
|