From cf61071056a2e125f1b08a1343e64a36039b82e4 Mon Sep 17 00:00:00 2001
From: bannikovilea <i.bannikov.kontur@gmail.com>
Date: Tue, 26 Oct 2021 03:04:43 +0500
Subject: [PATCH] Pack artifacts

---
 .github/workflows/main.yaml | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 391d196..71b2e6c 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -3,7 +3,7 @@ name: Java CI
 on: [push]
 
 jobs:
-  build:
+  tests:
     runs-on: ubuntu-latest
 
     steps:
@@ -14,4 +14,22 @@ jobs:
           java-version: '11'
           distribution: 'adopt'
       - name: Build with Maven
-        run: mvn --batch-mode --update-snapshots verify
\ No newline at end of file
+        run: mvn --batch-mode --update-snapshots verify
+          
+  pack-artifacts:
+    runs-on: ubuntu-latest
+    needs: tests
+    if: github.ref == 'refs/heads/master'
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up JDK 11
+        uses: actions/setup-java@v2
+        with:
+          java-version: '11'
+          distribution: 'adopt'
+      - name: Build with Maven
+        run: mvn --batch-mode --update-snapshots verify
+      - uses: actions/upload-artifact@v2
+        with:
+          name: artifacts
+          path: ${{ github.workspace }}/*/target/*.jar
\ No newline at end of file