From 6e9bc4011c31ec9c6bb439036526bf77cb0ddcd0 Mon Sep 17 00:00:00 2001 From: Doma Date: Mon, 31 May 2021 17:58:39 +0800 Subject: [PATCH] ci: semantic release --- .github/workflows/node.js.yml | 2 +- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ package.json | 10 ++++++---- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 75b201c..72898d8 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -20,4 +20,4 @@ jobs: node-version: '14' - run: npm ci - run: npm run build --if-present - - run: npm test + - run: npm test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9b1b728 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + branches: + - master + - 'ci/**' + +jobs: + release: + name: release + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + - run: npm ci + - name: Semantic Release + run: npx semantic-release + if: ${{ github.ref == 'refs/heads/master' }} + - name: Semantic Release (Dry run) + run: npx semantic-release --dry-run + if: ${{ startsWith(github.ref, 'refs/heads/ci') }} diff --git a/package.json b/package.json index 44f16da..9b121d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rsuite/interactions", - "version": "1.4.0", + "version": "0.0.0-development", "description": "Call rsuite Modal at ease.", "main": "lib", "types": "index.d.ts", @@ -12,11 +12,12 @@ "test": "npm run test:4 && npm run test:5", "test:4": "RSUITE=4 jest", "test:5": "RSUITE=5 jest", - "prepublishOnly": "npm run build && npm test" + "prepublishOnly": "npm run build && npm test", + "semantic-release": "semantic-release" }, "repository": { "type": "git", - "url": "git+https://github.com/rsuite/interactions.git" + "url": "https://github.com/rsuite/interactions.git" }, "files": [ "lib", @@ -104,7 +105,8 @@ "url-loader": "^2.2.0", "webpack": "^4.44.2", "webpack-cli": "^3.3.12", - "webpack-dev-server": "^3.11.0" + "webpack-dev-server": "^3.11.0", + "semantic-release": "^17.4.3" }, "browserslist": [ "> 1%",