Browse Source

Add a Job that attaches the JAR to the GH Release

Dominik Fuchß 4 years ago
parent
commit
81947ae02d
1 changed files with 21 additions and 4 deletions
  1. 21 4
      .github/workflows/publish.yml

+ 21 - 4
.github/workflows/publish.yml

@@ -1,15 +1,14 @@
-name: Deploy to Maven Central
+name: Deploy to Maven Central & GitHub
 on:
   workflow_dispatch:
   release:
     types: [created]
 jobs:
-  publish:
+  publish-maven-central:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v3
-      - name: Set up Maven Central Repository
-        uses: actions/setup-java@v3
+      - uses: actions/setup-java@v3
         with:
           java-version: '17'
           distribution: 'temurin'
@@ -26,3 +25,21 @@ jobs:
         run: mvn -P deployment -U -B deploy
         env:
           GPG_PASSPHRASE: ${{ secrets.PGP_PW }}
+
+  publish-release-artifact:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v3
+      - uses: actions/setup-java@v3
+        with:
+          java-version: '17'
+          distribution: 'temurin'
+      - name: Build JPlag
+        run: mvn -U -B clean package assembly:single
+
+      - name: Attach CLI to Release on GitHub
+        uses: softprops/action-gh-release@v1
+        if: startsWith(github.ref, 'refs/tags/')
+        with:
+          files: jplag.cli/target/jplag-*-jar-with-dependencies.jar
+          fail_on_unmatched_files: true