Skip to content

Commit

Permalink
#96: Now GitHub Packages is the snapshot repo in distributionManageme…
Browse files Browse the repository at this point in the history
…nt. Refactored the snapshot-release to be a separate workflow, triggered by the finished build/push workflow.
  • Loading branch information
jonashackt committed Jan 12, 2021
1 parent 249d4bd commit 99bea03
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/github-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,3 @@ jobs:
with:
java-version: ${{ matrix.java-version }}
- run: mvn -B install --no-transfer-progress --file pom.xml

- name: Setup Java for publishing to GitHub Packages (only with Java 8)
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish SNAPSHOT version to GitHub Packages
run: mvn -B --no-transfer-progress deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/github-snapshot-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: github-snapshot-release

# Only trigger a SNAPSHOT release to GitHub Packages, when the build workflow succeeded
on:
workflow_run:
workflows: ["github-push"]
types:
- completed

jobs:
publish-snapshot:
runs-on: ubuntu-latest

steps:
- name: Setup Java for publishing to GitHub Packages (only with Java 8)
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish SNAPSHOT version to GitHub Packages
run: mvn -B --no-transfer-progress deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 1 addition & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<repository>
<snapshotRepository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/octocat/hello-world</url>
</repository>
<snapshotRepository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

Expand Down

0 comments on commit 99bea03

Please sign in to comment.