From 097e99eae872e743dda18aaee034118fb9c7c063 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Tue, 15 Oct 2024 10:32:19 -0700 Subject: [PATCH] Fix publish workflow --- .github/workflows/publish.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7ce57f9..8c5d734 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,21 +3,30 @@ name: Publish to NPM on: release: types: [created] + workflow_dispatch: permissions: contents: read jobs: - publish-npm: + test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - node-version: 14 - registry-url: https://registry.npmjs.org/ + node-version: 22.x - run: npm i - - run: node test/validateModuleExportsMatchCommonJS/index.js + - run: node ./test/runTests.js + + publish-npm: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + with: + node-version: 22.x - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}}