From 1bd6dd578b1326ed7979c301e3f8eb0f228f5b6f Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sun, 6 Oct 2024 12:14:38 +0000 Subject: [PATCH] ci(github actions): add publish.yml --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ CHANGELOG.md | 4 ++++ package.json | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..fb8c5086 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: publish to npmjs +on: + release: + types: [prereleased, released] +jobs: + build-and-publish: + # prevents this action from running on forks + if: github.repository == 'chimurai/http-proxy-middleware' + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22.x' + registry-url: 'https://registry.npmjs.org' + + - name: Install Dependencies + run: yarn install + + - name: Publish to NPM (beta) + if: 'github.event.release.prerelease' + run: npm publish --provenance --access public --tag v2-beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Publish to NPM (stable) + if: '!github.event.release.prerelease' + run: npm publish --provenance --access public --tag v2 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bc441d0..3969f00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v2.0.7](https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.7) + +- ci(github actions): add publish.yml + ## [v2.0.6](https://github.com/chimurai/http-proxy-middleware/releases/tag/v2.0.6) - fix(proxyReqWs): catch socket errors ([#763](https://github.com/chimurai/http-proxy-middleware/pull/763)) diff --git a/package.json b/package.json index 4b47b4ca..4c8e3743 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "http-proxy-middleware", - "version": "2.0.6", + "version": "2.0.7-beta.0", "description": "The one-liner node.js proxy middleware for connect, express and browser-sync", "main": "dist/index.js", "types": "dist/index.d.ts",