diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b5609e..6978b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Node.js setup ${{ matrix.node-version }} uses: actions/setup-node@v4 with: - cache: 'npm' + cache: npm cache-dependency-path: package-lock.json node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..84bac17 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,29 @@ +name: npm publish + +on: + pull_request: + types: [ closed ] + +jobs: + publish-npm: + if: github.event.pull_request.merged + runs-on: ubuntu-latest + + steps: + - name: Repository checkout + uses: actions/checkout@v4 + + - name: Node.js setup + uses: actions/setup-node@v4 + with: + cache: npm + cache-dependency-path: package-lock.json + node-version: 20.17.x + + - name: Dependencies installation + run: npm ci + + - env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + name: Publish to npm + run: npm publish diff --git a/package-lock.json b/package-lock.json index 3afe58b..c81e942 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stassi/leaf", - "version": "0.0.19", + "version": "0.0.20", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@stassi/leaf", - "version": "0.0.19", + "version": "0.0.20", "cpu": [ "arm64", "x64" diff --git a/package.json b/package.json index 0e7da20..4dd72d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stassi/leaf", - "version": "0.0.19", + "version": "0.0.20", "private": true, "description": "Leaflet adapter.", "keywords": [ @@ -32,6 +32,7 @@ "preimport:leaflet:fullscreen": "shx mkdir -p public/leaflet/fullscreen", "import:leaflet:fullscreen": "shx cp -r node_modules/leaflet-fullscreen/dist/* public/leaflet/fullscreen", "lint": "eslint .", + "prepublishOnly": "npm test", "serve": "serve", "serve:test": "serve -p 3001", "prestart": "npm run build",