Publish Snapshot to GitHub #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Snapshot to GitHub | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to publish, such as 1.3.0-SNAPSHOT' | |
required: true | |
default: '1.3.1-SNAPSHOT' | |
ref: | |
description: 'The Branch, Tag or SHA to use to publish Snapshot' | |
required: false | |
default: 'master' | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build_snapshot: | |
name: Build Snapshot | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ref }} | |
- name: Set up Java 21 and set GitHub for publishing in settings.xml | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'liberica' | |
java-version: 21 | |
cache: 'maven' | |
server-id: github | |
- name: Compile & Deploy to GitHub Packages | |
run: mvn -Drevision=${{ github.event.inputs.version }} --no-transfer-progress -B deploy -DdeployAtEnd --file pom.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |