Skip to content

Commit ea2f378

Browse files
committed
ci: re-write publish action
1 parent f534879 commit ea2f378

File tree

5 files changed

+21
-106
lines changed

5 files changed

+21
-106
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@ name: publish
22

33
on:
44
push:
5-
branches: ["main"]
5+
tags:
6+
- "*"
67

78
jobs:
89
publish:
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v3
12-
- uses: actions/setup-node@v3
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
1314
with:
14-
node-version: 16
15-
- uses: JS-DevTools/npm-publish@v1
16-
with:
17-
token: ${{ secrets.NPM_TOKEN }}
18-
greater-version-only: true
15+
node-version: "18.x"
16+
- name: Install dependencies
17+
run: npm ci
18+
19+
- run: npm version $(echo "${GITHUB_REF}" | sed 's/refs\/tags\///') --git-tag-version false
20+
- run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
21+
env:
22+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
- run: npm publish

.npmignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assemblyscript-prettier",
3-
"version": "2.0.2",
3+
"version": "0.0.0",
44
"description": "prettier for assemblyscript",
55
"main": "src/plugin.js",
66
"type": "module",
@@ -9,7 +9,7 @@
99
"lint:fix": "prettier -w .",
1010
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
1111
"test:create": "NODE_OPTIONS=--experimental-vm-modules jest --updateSnapshot",
12-
"version": "conventional-changelog -i CHANGELOG.md -s -p angular && git add CHANGELOG.md"
12+
"version": "conventional-changelog -o CHANGELOG.md -p angular -r 0"
1313
},
1414
"author": "congcongcai0907@163.com",
1515
"license": "MIT",
@@ -21,6 +21,12 @@
2121
"publishConfig": {
2222
"access": "public"
2323
},
24+
"files": [
25+
"package.json",
26+
"README.md",
27+
"CHANGELOG.md",
28+
"src/*"
29+
],
2430
"repository": {
2531
"type": "git",
2632
"url": "https://github.com/HerrCai0907/assemblyscript-prettier.git"

0 commit comments

Comments
 (0)