From 33122a9aeb8104349553ea0e3c4c7a6b7b5114d3 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 21:01:35 +0100 Subject: [PATCH 1/9] Add Github release/tag action --- .github/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index edb70d66fe0..ac5dd405e7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,4 +59,17 @@ jobs: run: | cd ui npm ci --prefer-offline --cache ~/.npm - node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" \ No newline at end of file + node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" + + - name: Prepare Release + if: startsWith(github.ref, 'refs/tags/') + run: | + ./gradlew buildEdge buildBackend + + - name: Release Files + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + build/openems-edge.jar + build/openems-backend.jar \ No newline at end of file From dcdc4f90f7c2b0862890b941972e3699a51db613 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 21:55:26 +0100 Subject: [PATCH 2/9] Try to merge steps --- .github/workflows/build.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac5dd405e7b..96d33a85bb0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,14 +61,11 @@ jobs: npm ci --prefer-offline --cache ~/.npm node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" - - name: Prepare Release - if: startsWith(github.ref, 'refs/tags/') - run: | - ./gradlew buildEdge buildBackend - - name: Release Files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') + run: | + ./gradlew buildEdge buildBackend with: files: | build/openems-edge.jar From c5d1a2d6c28ebdf974b773137532676eef664514 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 22:32:47 +0100 Subject: [PATCH 3/9] Add openems-ui zip --- .github/workflows/build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96d33a85bb0..29466cf2649 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,13 @@ jobs: cd ui npm ci --prefer-offline --cache ~/.npm node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" - + + - uses: montudor/action-zip@v1 + if: startsWith(github.ref, 'refs/tags/') + working-directory: ui/target + with: + args: zip -qq -r openems-ui.zip * + - name: Release Files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') @@ -69,4 +75,5 @@ jobs: with: files: | build/openems-edge.jar - build/openems-backend.jar \ No newline at end of file + build/openems-backend.jar + openems-ui.jar \ No newline at end of file From 84523ecd0604c57553c3b15523c277b4026c5bd1 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 22:35:38 +0100 Subject: [PATCH 4/9] Unmerge steps --- .github/workflows/build.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29466cf2649..5a0cc1207fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,13 @@ jobs: npm ci --prefer-offline --cache ~/.npm node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" - - uses: montudor/action-zip@v1 + - name: Prepare Edge+Backend Release + if: startsWith(github.ref, 'refs/tags/') + run: | + ./gradlew buildEdge buildBackend + + - name: Prepare UI Release + uses: montudor/action-zip@v1 if: startsWith(github.ref, 'refs/tags/') working-directory: ui/target with: @@ -70,8 +76,6 @@ jobs: - name: Release Files uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') - run: | - ./gradlew buildEdge buildBackend with: files: | build/openems-edge.jar From 636526b018832ac8ab6a7d4eb9f6756c87f20f1a Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 22:38:57 +0100 Subject: [PATCH 5/9] Switch zip action --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a0cc1207fd..4e475441c5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,15 +67,16 @@ jobs: ./gradlew buildEdge buildBackend - name: Prepare UI Release - uses: montudor/action-zip@v1 if: startsWith(github.ref, 'refs/tags/') - working-directory: ui/target + uses: papeloto/action-zip@v1 with: - args: zip -qq -r openems-ui.zip * + files: target/ui/* + recursive: false + dest: openems-ui.zip - name: Release Files - uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 with: files: | build/openems-edge.jar From 5d32ff2116ad61760c4e1b959f12aa9c7e56d69f Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 22:43:52 +0100 Subject: [PATCH 6/9] Fix vimtor action; set release to draft --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e475441c5c..9a96fb1f59b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,6 +61,10 @@ jobs: npm ci --prefer-offline --cache ~/.npm node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" + # + # Following steps only run on Tags/Releases + # + - name: Prepare Edge+Backend Release if: startsWith(github.ref, 'refs/tags/') run: | @@ -68,7 +72,7 @@ jobs: - name: Prepare UI Release if: startsWith(github.ref, 'refs/tags/') - uses: papeloto/action-zip@v1 + uses: vimtor/action-zip@v1 with: files: target/ui/* recursive: false @@ -78,6 +82,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: + draft: true files: | build/openems-edge.jar build/openems-backend.jar From 1debb16d40f53c8ed8c2194f0bd2ef342fd8a47b Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 23:06:30 +0100 Subject: [PATCH 7/9] Switch to 7z --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a96fb1f59b..601236435dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,11 +72,9 @@ jobs: - name: Prepare UI Release if: startsWith(github.ref, 'refs/tags/') - uses: vimtor/action-zip@v1 + uses: edgarrc/action-7z@v1 with: - files: target/ui/* - recursive: false - dest: openems-ui.zip + args: 7z a openems-ui.zip ./ui/target/* - name: Release Files if: startsWith(github.ref, 'refs/tags/') From c85c2e353763854f2977902f35d7cddc5fef9a90 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 23:18:35 +0100 Subject: [PATCH 8/9] Fix typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 601236435dd..81172adc36e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,4 +84,4 @@ jobs: files: | build/openems-edge.jar build/openems-backend.jar - openems-ui.jar \ No newline at end of file + openems-ui.zip \ No newline at end of file From c24326183533715078cb8c38c2923c15900097f0 Mon Sep 17 00:00:00 2001 From: Stefan Feilmeier Date: Mon, 10 Jan 2022 23:35:29 +0100 Subject: [PATCH 9/9] Finalize github actions yml --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81172adc36e..31562249017 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,21 +62,20 @@ jobs: node_modules/@angular/cli/bin/ng build -c "openems,openems-edge-prod,prod" # - # Following steps only run on Tags/Releases + # Is this a Tag? Prepare release assets and create a draft release # - - - name: Prepare Edge+Backend Release + - name: Prepare Edge+Backend assets if: startsWith(github.ref, 'refs/tags/') run: | ./gradlew buildEdge buildBackend - - name: Prepare UI Release + - name: Prepare UI asset if: startsWith(github.ref, 'refs/tags/') uses: edgarrc/action-7z@v1 with: args: 7z a openems-ui.zip ./ui/target/* - - name: Release Files + - name: Create draft Release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: