From 7ff2566ea4e553427ccbe5a37122e3d7f7fbbf37 Mon Sep 17 00:00:00 2001 From: Chieffo Date: Mon, 13 Dec 2021 17:39:35 +0800 Subject: [PATCH] workflow: add publish.yml --- .github/workflows/publish.yml | 41 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 42 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 0000000..aca2b82 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,41 @@ +name: Publish + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: '14' + registry-url: 'https://registry.npmjs.org' + + - name: Install + run: npm install + + - name: Build + run: npm run build + + - name: Test + run: npm run test + + - name: Create Release for Tag + id: release_tag + uses: yyx990803/release-tag@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + body: | + Please refer to [CHANGELOG.md](https://github.com/originjs/webpack-to-vite/blob/main/CHANGELOG.md) for details. + - name: Publish to npm registry + run: | + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/package.json b/package.json index 4eae0bd..c69a149 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@originjs/webpack-to-vite", - "version": "1.0.1", + "version": "1.0.2", "description": "convert a webpack project to a vite project", "main": "dist/bin/index.js", "bin": {