From b718c47989696ff3b1bfacc16e4ed27663aa934c Mon Sep 17 00:00:00 2001 From: IAvecilla Date: Fri, 4 Nov 2022 13:12:04 -0300 Subject: [PATCH] Add publish workflow --- .../{github-actions.yml => checks.yml} | 0 .github/workflows/publish-package.yml | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+) rename .github/workflows/{github-actions.yml => checks.yml} (100%) create mode 100644 .github/workflows/publish-package.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/checks.yml similarity index 100% rename from .github/workflows/github-actions.yml rename to .github/workflows/checks.yml diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..b96224e --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,27 @@ +name: Publish Package to NPM +on: + release: + types: [published] + jobs: + build: + runs-on: [self-hosted] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.target_commitish }} + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: "18" + registry-url: "https://registry.npmjs.org" + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Update package version + run: npm version ${{ github.event.release.tag_name }} + - name: Publish Package on NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}