Skip to content

Add GH build workflow #2

Add GH build workflow

Add GH build workflow #2

Workflow file for this run

name: Build and Publish
on:
workflow_dispatch:
push:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt-hotspot
- name: Setup maven repo
uses: s4u/[email protected]
with:
servers: |
[{
"id": "waterdog-snapshots",
"username": "${{ secrets.DEPLOY_USERNAME }}",
"password": "${{ secrets.DEPLOY_PASSWORD }}"
}]
- name: Build
if: ${{ github.ref != 'refs/heads/master' }}
run: mvn -B clean package
shell: bash
- name: Build and Deploy
if: ${{ github.ref == 'refs/heads/master' }}
run: mvn -B clean package
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: waterdog
path: waterdogpe/target/stargate-waterdogpe-*.jar
- name: Create pre-release
if: ${{ github.ref != 'refs/heads/master' }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Snapshot Build"
files: |
waterdogpe/target/stargate-waterdogpe-*.jar