Skip to content

Commit

Permalink
Add GH build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Oct 1, 2023
1 parent 1303eba commit c0da897
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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

0 comments on commit c0da897

Please sign in to comment.