From 0d3e9ba4131c5f41494fb4f830f4bf369f068e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 10:59:36 +0200 Subject: [PATCH 1/7] automatic tag and release on merge to master --- .github/workflows/nodejs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 346debf3..dbb23ac5 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -46,6 +46,10 @@ jobs: - run: npm run build:prod - run: npm test - uses: JS-DevTools/npm-publish@v1 + id: publishNpm with: token: ${{ secrets.NPM_TOKEN }} dry-run: false + - run: gh release create ${{ steps.publishNpm.outputs.version }} --generate-notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e506935e3538665525ade5f9a2e17bfdefafa227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 11:00:44 +0200 Subject: [PATCH 2/7] add env to deploy action --- .github/workflows/nodejs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index dbb23ac5..4ff8c723 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,6 +5,7 @@ on: [push] jobs: build: runs-on: ${{ matrix.os }} + environment: production strategy: matrix: From 4025f9982cb34ea6a37372dd83f659d2df015864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 11:56:11 +0200 Subject: [PATCH 3/7] added action as draft release --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4ff8c723..abb75be7 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -51,6 +51,6 @@ jobs: with: token: ${{ secrets.NPM_TOKEN }} dry-run: false - - run: gh release create ${{ steps.publishNpm.outputs.version }} --generate-notes + - run: gh release create ${{ steps.publishNpm.outputs.version }} --generate-notes --draft env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ef077a17547cbe661e1c05b7cc678b925dd207ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 11:59:53 +0200 Subject: [PATCH 4/7] fixed so only publish step sets environment --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index abb75be7..efafbe39 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,7 +5,6 @@ on: [push] jobs: build: runs-on: ${{ matrix.os }} - environment: production strategy: matrix: @@ -34,6 +33,7 @@ jobs: CI: true publish: + environment: production needs: build if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest From 9fc18482096fc3ee290f95dd47d7516e93ae4b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 14:47:50 +0200 Subject: [PATCH 5/7] removed draft --- .github/workflows/nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index efafbe39..77399894 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -51,6 +51,6 @@ jobs: with: token: ${{ secrets.NPM_TOKEN }} dry-run: false - - run: gh release create ${{ steps.publishNpm.outputs.version }} --generate-notes --draft + - run: gh release create ${{ steps.publishNpm.outputs.version }} --generate-notes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5c97d9aba481ab07234d4e23837db8d4e732638a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 14:54:12 +0200 Subject: [PATCH 6/7] commented code to test changes --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 77399894..e1b65beb 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,9 +33,9 @@ jobs: CI: true publish: - environment: production + # environment: production needs: build - if: github.ref == 'refs/heads/master' + # if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From ce72b2a924536cec79592c460e2917148c7ec427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anne-Siri=20Tr=C3=B8nnes?= Date: Fri, 27 Oct 2023 15:00:07 +0200 Subject: [PATCH 7/7] added check for master --- .github/workflows/nodejs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e1b65beb..77399894 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -33,9 +33,9 @@ jobs: CI: true publish: - # environment: production + environment: production needs: build - # if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3