2021-03-01 21:04:06 +01:00
|
|
|
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
|
|
|
|
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
|
|
|
|
|
|
|
|
name: Maven Package
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * 0' # weekly
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { os: ubuntu-20.04, arch: "linux/amd64" }
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
submodules: "recursive"
|
|
|
|
- name: Setup variables
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
# ====== Variables
|
2023-01-17 16:14:00 +01:00
|
|
|
export REVISION=1.0.${{ github.run_number }}
|
2021-03-01 21:04:06 +01:00
|
|
|
|
|
|
|
echo "REVISION=$REVISION" >> $GITHUB_ENV
|
2021-10-09 00:45:32 +02:00
|
|
|
- name: Set up JDK 17
|
2021-03-01 21:04:06 +01:00
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2021-10-09 00:45:32 +02:00
|
|
|
java-version: 17
|
2021-03-01 21:04:06 +01:00
|
|
|
server-id: mchv-release-distribution
|
|
|
|
server-username: MAVEN_USERNAME
|
|
|
|
server-password: MAVEN_PASSWORD
|
|
|
|
env:
|
|
|
|
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
|
|
|
|
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
|
|
|
|
- name: Deploy to Maven (Release)
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "REVISION: $REVISION"
|
|
|
|
|
|
|
|
mvn -B -Drevision=${REVISION} clean deploy
|
|
|
|
env:
|
|
|
|
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
|
|
|
|
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
|