-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Workflow For Publishing GitHub Packages (#13)
- Loading branch information
Ian Tapply
authored
Jun 6, 2024
1 parent
1c21dee
commit 587b08a
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Publish Package to GitHub Packages | ||
|
||
# Triggered on pushes to main | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
# Jobs are only triggered when the commit message starts with 'feat' | ||
jobs: | ||
# Publishes the package to GitHub Packages | ||
publish: | ||
name: Publish Package | ||
if: ${{ startsWith(github.event.head_commit.message, 'feat') }} | ||
runs-on: ubuntu-latest | ||
environment: jdk21-publishing | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
# This job publishes the package to GitHub Packages via mvn deploy | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ vars.JAVA_VERSION }} | ||
distribution: ${{ vars.JAVA_DISTRIBUTION }} | ||
|
||
- name: Publish package | ||
run: mvn --batch-mode deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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