Skip to content

Commit

Permalink
Add GitHub Actions Workflow Maven Package and Publish (#8)
Browse files Browse the repository at this point in the history
Configure to publish GitHub Packages Apache Maven
  • Loading branch information
joariasl authored Jun 12, 2024
1 parent a6afc16 commit 420be89
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Maven Package and Publish

on:
release:
types: [created]
push:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 1.8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn --batch-mode deploy -P github
env:
GITHUB_TOKEN: ${{ github.token }}
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<groupId>cl.zetta</groupId>
<artifactId>sii-schemas-lib-java</artifactId>
<artifactId>sii-schemas</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
Expand Down Expand Up @@ -119,4 +119,17 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/zetta-biz/sii-schemas-lib-java</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit 420be89

Please sign in to comment.