diff --git a/.github/workflows/npm-release.yml b/.github/workflows/npm-release.yml index 7406eed..717edb4 100644 --- a/.github/workflows/npm-release.yml +++ b/.github/workflows/npm-release.yml @@ -5,6 +5,8 @@ name: Publish to NPM on: workflow_dispatch: + release: + types: [created] jobs: build: @@ -19,6 +21,18 @@ jobs: node-version: 16 cache: yarn + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: "change version" + uses: dmikey/package-json-version@v0.0.2 + with: + version: ${{ steps.get_release.outputs.tag_name }} + package: "./" + - name: Install dependencies run: yarn install @@ -30,4 +44,4 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.npm_token }} run: | echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > ~/.npmrc - npm publish --access public \ No newline at end of file + npm publish --access public