From b2c62547899f0caf42f85c1f4c95c99b0eed8f31 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Wed, 24 Nov 2021 22:41:43 +0100 Subject: [PATCH] Create npm releases on github tags --- .github/workflows/ci.yml | 21 +++++++++++---------- .npmrc | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .npmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3656345..a2b455d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,9 @@ name: CI on: push: pull_request: - release: - types: [published] + create: + tags: + - v* workflow_dispatch: @@ -14,13 +15,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 16.x - - run: npm i --no-optional - - run: npm i eslint eslint-plugin-node - - run: npm run lint + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + - run: npm i --no-optional + - run: npm i eslint eslint-plugin-node + - run: npm run lint lualint: name: Luacheck runs-on: ubuntu-latest @@ -36,7 +37,7 @@ jobs: name: "Publish to npm" runs-on: ubuntu-latest - if: github.event.release.action == 'released' + if: github.event.ref_type == 'tag' && startsWith(github.event.ref, 'v') steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..f3b1a9f --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}