Skip to content

Build Main/Master SNAPSHOT #199

Build Main/Master SNAPSHOT

Build Main/Master SNAPSHOT #199

Workflow file for this run

name: Build Main/Master SNAPSHOT
on:
workflow_dispatch:
schedule:
- cron: "5 6 * * *"
push:
branches:
- 'main'
- 'master'
env:
MAVEN_VERSION: '3.9.2'
jobs:
build-master:
name: Build & Package Master
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to GitHub Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: liquibase
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: ${{ env.MAVEN_VERSION }}
# Version artifact based off of branch and commit SHA.
- name: Version Artifact
run: mvn versions:set -DnewVersion="master-SNAPSHOT"
# Publish to GitHub Packages
- name: Publish package
run: mvn -B clean deploy -DskipTests=true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-sha:
name: Build & Package SHA
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up Java for publishing to GitHub Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
server-id: liquibase
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: ${{ env.MAVEN_VERSION }}
# Version artifact based off of branch and commit SHA.
- name: Version Artifact
run: mvn versions:set -DnewVersion="$(git rev-parse --short HEAD)-SNAPSHOT"
# This would still deploy a package if there are test failures. Might help to have build.yml complete and then run this workflow
# Publish to GitHub Packages
- name: Publish package
run: mvn -B clean deploy -DskipTests=true "-Dbuild.branch=${{ github.ref_name }}" "-Dbuild.number=${{ github.run_number }}" "-Dbuild.commit=${{ github.sha }}" "-Dbuild.repository.owner=${{ github.repository_owner }}" "-Dbuild.repository.name=${{ github.repository }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}