From 6ac5b406625068925667c8956df3474c89c13dda Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 16:50:53 +0100 Subject: [PATCH 1/8] combine build-and-release.yml with publish.yml --- ...-release.yml => build-release-publish.yml} | 17 ++++++++++++++ .github/workflows/publish.yml | 23 ------------------- 2 files changed, 17 insertions(+), 23 deletions(-) rename .github/workflows/{build-and-release.yml => build-release-publish.yml} (84%) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-release-publish.yml similarity index 84% rename from .github/workflows/build-and-release.yml rename to .github/workflows/build-release-publish.yml index 46d181c..5d22085 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-release-publish.yml @@ -93,3 +93,20 @@ jobs: asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + - run: npm install -g pver + - run: npm ci + - run: npm run build + - run: pver release + env: + NODE_AUTH_TOKEN: ${{ secrets.SEAMAPI_NPM_TOKEN }} + # Make sure seambot is configured to bypass branch protection and + # dismiss PR reviews + GITHUB_TOKEN: ${{ secrets.BOT_GH_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index ca6beba..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Publish to npm -on: - push: - branches: - - main -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: npm install -g pver - - run: npm ci - - run: npm run build - - run: pver release - env: - NODE_AUTH_TOKEN: ${{ secrets.SEAMAPI_NPM_TOKEN }} - # Make sure seambot is configured to bypass branch protection and - # dismiss PR reviews - GITHUB_TOKEN: ${{ secrets.BOT_GH_TOKEN }} From 2f15ad5731964ed8e41199837f2bfb96647abc56 Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 16:56:19 +0100 Subject: [PATCH 2/8] make publish require build-and-release to finish --- .github/workflows/build-release-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-release-publish.yml b/.github/workflows/build-release-publish.yml index 5d22085..9c0ba74 100644 --- a/.github/workflows/build-release-publish.yml +++ b/.github/workflows/build-release-publish.yml @@ -94,6 +94,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish: + needs: build-and-release runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From d2ebc6e7808fb69265875cebd67458f958558438 Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 17:32:25 +0100 Subject: [PATCH 3/8] run pver release before getting the version --- .github/workflows/build-release-publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-release-publish.yml b/.github/workflows/build-release-publish.yml index 9c0ba74..8eab2d3 100644 --- a/.github/workflows/build-release-publish.yml +++ b/.github/workflows/build-release-publish.yml @@ -39,6 +39,11 @@ jobs: - name: Install jq run: sudo apt-get install jq + - name: Install pver + run: | + npm install -g pver + pver release + - name: Get the version from package.json run: | export VERSION_TAG=$(jq -r '.version' package.json) From cb2e34a3afcabab2e9ceb13f84e19b54677d41e3 Mon Sep 17 00:00:00 2001 From: Pawel <41388251+kainpets@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:35:10 +0100 Subject: [PATCH 4/8] Remove publish job --- .github/workflows/build-release-publish.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/build-release-publish.yml b/.github/workflows/build-release-publish.yml index 8eab2d3..d053bc1 100644 --- a/.github/workflows/build-release-publish.yml +++ b/.github/workflows/build-release-publish.yml @@ -98,21 +98,3 @@ jobs: asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish: - needs: build-and-release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 20 - registry-url: https://registry.npmjs.org/ - - run: npm install -g pver - - run: npm ci - - run: npm run build - - run: pver release - env: - NODE_AUTH_TOKEN: ${{ secrets.SEAMAPI_NPM_TOKEN }} - # Make sure seambot is configured to bypass branch protection and - # dismiss PR reviews - GITHUB_TOKEN: ${{ secrets.BOT_GH_TOKEN }} From 80b97006bc59df51a2b6ae72118d6a6ceb69be3e Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 17:37:30 +0100 Subject: [PATCH 5/8] add install pver and create new release step --- .github/workflows/build-release-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release-publish.yml b/.github/workflows/build-release-publish.yml index d053bc1..bb6024a 100644 --- a/.github/workflows/build-release-publish.yml +++ b/.github/workflows/build-release-publish.yml @@ -39,7 +39,7 @@ jobs: - name: Install jq run: sudo apt-get install jq - - name: Install pver + - name: Install pver and create new release run: | npm install -g pver pver release From 36c371f7d956ff1d3d0ca2d40f209e47f1d2129f Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 17:53:05 +0100 Subject: [PATCH 6/8] add env --- .github/workflows/build-release-publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-release-publish.yml b/.github/workflows/build-release-publish.yml index bb6024a..b0f7fc9 100644 --- a/.github/workflows/build-release-publish.yml +++ b/.github/workflows/build-release-publish.yml @@ -43,6 +43,9 @@ jobs: run: | npm install -g pver pver release + env: + NODE_AUTH_TOKEN: ${{ secrets.SEAMAPI_NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.BOT_GH_TOKEN }} - name: Get the version from package.json run: | From 336681303a8a6d7b5e8d532750f5e86155266b0d Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 18:09:49 +0100 Subject: [PATCH 7/8] add bin to .npmignore --- .npmignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c5e82d7 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +bin \ No newline at end of file From b14ac240abc04b14f4e76b8329bd6b2698e64833 Mon Sep 17 00:00:00 2001 From: kainpets Date: Thu, 29 Feb 2024 18:17:06 +0100 Subject: [PATCH 8/8] remove .npmignore --- .npmignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index c5e82d7..0000000 --- a/.npmignore +++ /dev/null @@ -1 +0,0 @@ -bin \ No newline at end of file