Skip to content

Commit

Permalink
Create Workflow For Publishing GitHub Packages (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Tapply authored Jun 6, 2024
1 parent 1c21dee commit 587b08a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
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 }}
8 changes: 8 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
<description>A unique balloons plugin by Jeqo.</description>
<url>https://jeqo.net/bloons</url>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/Jeqo-Studios/Bloons</url>
</repository>
</distributionManagement>

<properties>
<java.version>1.21</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 587b08a

Please sign in to comment.