From 99b9385aa92aacb3ee2ac058c94bba7465d76d85 Mon Sep 17 00:00:00 2001 From: Yu Chun Tsao Date: Mon, 30 Oct 2023 16:10:29 +0800 Subject: [PATCH] Add release action and use semantic-release --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ package.json | 8 +++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a8588c2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release +on: + push: + branches: + - main +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18] + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2 + with: + version: 8 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install dependencies + run: pnpm install + - name: Release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/package.json b/package.json index fe9bc41..b8bbc7e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "maplibre-gl-overview-map", "private": false, - "version": "0.0.3", + "version": "0.0.0-development", "description": "An overview map plugin for mapligre-gl-js.", "license": "MIT", "author": "YuChunTsao", @@ -39,14 +39,16 @@ "build": "tsc && vite build", "release": "tsc && vite build --mode lib", "preview": "vite preview", - "format": "prettier . --write" + "format": "prettier . --write", + "semantic-release": "semantic-release" }, "devDependencies": { "@types/node": "^20.8.9", "prettier": "^3.0.3", "typescript": "^5.0.2", "vite": "^4.4.5", - "vite-plugin-dts": "^3.6.2" + "vite-plugin-dts": "^3.6.2", + "semantic-release": "^22.0.5" }, "dependencies": { "maplibre-gl": "^3.5.1"