Skip to content

Commit dc82f06

Browse files
committed
Add Github Actions based publisher
1 parent b90d30f commit dc82f06

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

.github/workflows/npm-publish.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 16
15+
registry-url: https://registry.npmjs.org/
16+
- run: |
17+
git config --global user.name "Inertia.js Publisher (BOT)"
18+
git config --global user.email "[email protected]"
19+
- run: npm install
20+
- run: |
21+
git tag -d ${{ github.event.release.tag_name }} || true
22+
npm version ${{ github.event.release.tag_name }} -m "Tag @inertiajs/progress ${{ github.event.release.tag_name }}"
23+
git push origin HEAD:master
24+
git push --force origin refs/tags/${{ github.event.release.tag_name }}:refs/tags/${{ github.event.release.tag_name }}
25+
- run: npm publish
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"unpkg": "dist/index.umd.js",
1212
"types": "types.d.ts",
1313
"scripts": {
14-
"build": "npm run build:cjs && npm run build:umd",
14+
"build": "npm run clean && npm run build:cjs && npm run build:umd",
1515
"build:cjs": "microbundle --format cjs",
1616
"build:umd": "microbundle --format umd --name Inertia --external none",
17+
"clean": "rm -rf dist",
1718
"prepublishOnly": "npm run build",
1819
"watch": "microbundle watch --format cjs"
1920
},

0 commit comments

Comments
 (0)