From 79d09bde77f0b1f0d04c620c274f36b4f65c034d Mon Sep 17 00:00:00 2001 From: George Satellite Date: Sun, 8 Oct 2023 17:04:10 +0300 Subject: [PATCH] CI: publish workflow --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b72a9cb..abed699 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9388e09 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish + +on: workflow_dispatch + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Publish to NPM + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + pushd ./packages/react-knob-headless + echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > .npmrc + npm publish + popd