Skip to content

testing snapshot publishing #4

testing snapshot publishing

testing snapshot publishing #4

name: Publish Java Package
on:
workflow_call:
inputs:
drop-snapshot:
description: 'Drop snapshot from version'
required: true
type: boolean
secrets:
GITHUB_TOKEN:

Check failure on line 11 in .github/workflows/artifact-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/artifact-publish.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
- name: Remove snapshot from version
if: ${{ github.event.inputs.drop-snapshot == 'true' }}
run: mvn versions:set -DremoveSnapshot
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages
run: mvn --batch-mode -Dgithub_organization=${{ github.repository_owner }} deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}