From 18f53d56b84ca96ea0c860bb015b42d20b2c4065 Mon Sep 17 00:00:00 2001 From: Raul Melo Date: Sun, 11 Feb 2024 18:19:35 +0100 Subject: [PATCH] add release to npm --- .github/workflows/release.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14a48b4..4574088 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,11 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v4 with: go-version: 1.21.7 @@ -29,6 +27,21 @@ jobs: distribution: goreleaser version: latest args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/setup-node@v4 + name: Setup Node + with: + node-version: 20 + + - name: Generate NPM files + run: | + go run ./scripts/npm.go + - name: Publish to NPM + run: | + cd dist-npm + npm publish env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file