From ded06ae3b9905e4b23516d176598594f5b262a68 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Thu, 21 Jul 2022 13:38:56 +0200 Subject: [PATCH] Add release workflow --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bd2ca7..5610ed4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,20 @@ jobs: - run: npm ci - run: npx eslint . + pack: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - run: npm ci + - run: npm pack + - uses: actions/upload-artifact@v3 + with: + name: package + path: '*.tgz' + test: runs-on: ubuntu-latest strategy: @@ -52,3 +66,18 @@ jobs: node-version: 18 - run: npm ci - run: npx tsc + + release: + runs-on: ubuntu-latest + needs: [eslint, test, pack, prettier, tsc] + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: https://registry.npmjs.org + - uses: actions/download-artifact@v3 + with: { name: package } + - run: npm publish *.tgz + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}