48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: RELEASE - Build and Publish
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
packages: write
|
|
name: Build and Publish
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-java@v4.2.2
|
|
with:
|
|
distribution: zulu
|
|
java-version: 17
|
|
- name: Config Git
|
|
run: |
|
|
git config --global user.email "edward@cheng.sydney"
|
|
git config --global user.name "3dwardch3ng"
|
|
git config --global core.autocrlf input
|
|
- name: Start release
|
|
run: mvn gitflow:release-start -B -DpushRemote=true -DallowSnapshots=true
|
|
- name: Maven Publish
|
|
env:
|
|
GITHUB_ACTOR: '3dwardch3ng'
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
NEXUS_USERNAME: 'edward'
|
|
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
DEPLOYMENT_REPOSITORY_ID: ${{ secrets.DEPLOYMENT_REPOSITORY_ID }}
|
|
SNAPSHOT_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.SNAPSHOT_DEPLOYMENT_REPOSITORY_URL }}
|
|
RELEASE_DEPLOYMENT_REPOSITORY_URL: ${{ secrets.RELEASE_DEPLOYMENT_REPOSITORY_URL }}
|
|
run: |
|
|
mvn -B deploy \
|
|
-P homelab \
|
|
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
- name: Finish release
|
|
run: mvn gitflow:release-finish -B -DpushRemote=true -DallowSnapshots=true -DproductionBranch=main
|
|
env:
|
|
GITHUB_ACTOR: 3dwardch3ng
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |