50 lines
1.7 KiB
YAML
50 lines
1.7 KiB
YAML
name: RELEASE - Build and Publish
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
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@v3.13.0
|
|
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 -X -B deploy \
|
|
-P publish \
|
|
--settings=${{ github.workspace }}/.mvn/settings.xml
|
|
- name: Finish release
|
|
run: mvn gitflow:release-finish -B -DpushRemote=true -DallowSnapshots=true
|
|
env:
|
|
GITHUB_ACTOR: 3dwardch3ng
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
- uses: actions/upload-artifact@v3.1.3
|
|
if: always()
|
|
with:
|
|
name: Java Artifacts
|
|
path: ${{ github.workspace }}/**/target/*.* |