diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 95ccb01..393a185 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,18 +18,39 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - run: npm ci - run: npm run ci - - uses: JS-DevTools/npm-publish@v3 + - name: Publish to NPM if version in package.json has changed + id: publish + uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} provenance: true + - name: Create tag + if: steps.publish.outputs.type + uses: actions/github-script@v6 + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: 'refs/tags/v${{ steps.publish.outputs.version }}', + sha: context.sha + }) + - name: Create a Github Release when a version was published + if: steps.publish.outputs.type + uses: ncipollo/release-action@v1 + with: + tag: v${{ steps.publish.outputs.version }} + name: v${{ steps.publish.outputs.version }} + makeLatest: true permissions: id-token: write + contents: write diff --git a/package.json b/package.json index 68fe54a..fa1f795 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "prepare": "husky install", "prepublishOnly": "tsa clean && npm run dist", "assist": "tsa assist", - "release": "tsa release", + "release": "echo 'You can make a release by updating the version number in package.json and push the changes'", "fix": "tsa fix", "fixall": "tsa fixall", "clean": "tsa clean", @@ -89,7 +89,7 @@ "rollup": "4.9.6", "sinon": "17.0.1", "sinon-chai": "3.7.0", - "typescript-assistant": "0.65.7" + "typescript-assistant": "0.66.9" }, "importSort": { ".js, .jsx, .ts, .tsx": {