From e64cf7f574f5f22bfaadbcfb414d6bc38e12ba08 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:17:21 -0400 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9E=95=20connorjs/github-workflows,=20np?= =?UTF-8?q?m-publish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces in-repo Publish job with shared `npm-publish~v1`. +semver:none --- .github/workflows/pipeline.yaml | 36 +++++---------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 2f78f97..6b64a18 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -9,7 +9,7 @@ on: jobs: CiBuild: name: CI Build - uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@main + uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@features/npm-pack-and-publish PipelineTests: name: Test (${{ matrix.node }} | ${{ matrix.platform.os }}) @@ -93,37 +93,11 @@ jobs: Publish: name: Publish - if: ${{ github.ref == 'refs/heads/main' }} needs: - CiBuild # For version variable - PipelineTests # Requires passing tests - runs-on: ubuntu-latest - env: - semVer: ${{needs.CiBuild.outputs.semVer}} - permissions: - contents: write - id-token: write - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - cache: npm - node-version-file: .node-version - registry-url: https://registry.npmjs.org - - - name: Set version - run: sed -i 's/0.0.0-gitversion/${{ env.semVer }}/g' package.json - - name: Install - run: npm ci - - - name: Publish - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: git tag - run: | - git tag v${{ env.semVer }} - git push origin tag v${{ env.semVer }} + uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@features/npm-pack-and-publish + with: + npmPackFilename: ${{needs.CiBuild.outputs.npmPackFilename}} + semVer: ${{needs.CiBuild.outputs.semVer}} From 6e353ac27e8716891a9f96302e5e428dd13d2409 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:24:18 -0400 Subject: [PATCH 2/7] Add permissions --- .github/workflows/pipeline.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 6b64a18..34a0742 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -9,8 +9,14 @@ on: jobs: CiBuild: name: CI Build + uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@features/npm-pack-and-publish + permissions: + attestations: write + contents: read + id-token: write + PipelineTests: name: Test (${{ matrix.node }} | ${{ matrix.platform.os }}) defaults: @@ -101,3 +107,7 @@ jobs: with: npmPackFilename: ${{needs.CiBuild.outputs.npmPackFilename}} semVer: ${{needs.CiBuild.outputs.semVer}} + + permissions: + contents: write + id-token: write From e7cc66e91d816f3c089ec239ba779de77ca60263 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:26:27 -0400 Subject: [PATCH 3/7] Allow manual runs --- .github/workflows/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 34a0742..d60e90e 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: branches: [main] + workflow_dispatch: {} jobs: CiBuild: From c8255b440077b5000c26028fead417cc2ef0dd86 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:31:06 -0400 Subject: [PATCH 4/7] Revert "Allow manual runs" This reverts commit e7cc66e91d816f3c089ec239ba779de77ca60263. --- .github/workflows/pipeline.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index d60e90e..34a0742 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -5,7 +5,6 @@ on: branches: [main] pull_request: branches: [main] - workflow_dispatch: {} jobs: CiBuild: From 9454aab3c5348f2a105b4cee6e788b50dd92b668 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:43:45 -0400 Subject: [PATCH 5/7] Remove no-longer-needed ci build permissions --- .github/workflows/pipeline.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 34a0742..3484b7b 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -9,14 +9,8 @@ on: jobs: CiBuild: name: CI Build - uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@features/npm-pack-and-publish - permissions: - attestations: write - contents: read - id-token: write - PipelineTests: name: Test (${{ matrix.node }} | ${{ matrix.platform.os }}) defaults: From 997de3ce1eac4124f602b02ff5117d3b03083a7c Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:50:34 -0400 Subject: [PATCH 6/7] Pass secret --- .github/workflows/pipeline.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 3484b7b..505ab2b 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -99,8 +99,10 @@ jobs: uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@features/npm-pack-and-publish with: - npmPackFilename: ${{needs.CiBuild.outputs.npmPackFilename}} - semVer: ${{needs.CiBuild.outputs.semVer}} + npmPackFilename: ${{ needs.CiBuild.outputs.npmPackFilename }} + semVer: ${{ needs.CiBuild.outputs.semVer }} + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} permissions: contents: write From 4839a1a4ce15252d96bc01b6cad7df11b766ad85 Mon Sep 17 00:00:00 2001 From: Connor Sullivan Date: Mon, 5 Aug 2024 22:59:42 -0400 Subject: [PATCH 7/7] Back to main, ready for PR --- .github/workflows/pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 505ab2b..039a6da 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -9,7 +9,7 @@ on: jobs: CiBuild: name: CI Build - uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@features/npm-pack-and-publish + uses: connorjs/github-workflows/.github/workflows/npm-ci-build~v1.yaml@main PipelineTests: name: Test (${{ matrix.node }} | ${{ matrix.platform.os }}) @@ -97,7 +97,7 @@ jobs: - CiBuild # For version variable - PipelineTests # Requires passing tests - uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@features/npm-pack-and-publish + uses: connorjs/github-workflows/.github/workflows/npm-publish~v1.yaml@main with: npmPackFilename: ${{ needs.CiBuild.outputs.npmPackFilename }} semVer: ${{ needs.CiBuild.outputs.semVer }}