Skip to content

Commit 939803e

Browse files
author
huhuhang
committed
publish to npm
1 parent 73517fa commit 939803e

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Node.js Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 当推送以 v 开头的标签时触发
7+
8+
jobs:
9+
publish-npm:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: '18.x'
16+
registry-url: 'https://registry.npmjs.org'
17+
18+
# 这一步会读取 package.json 中的版本
19+
- name: Check version
20+
run: echo "Version is $(node -p "require('./package.json').version")"
21+
22+
# 发布到 npm
23+
- run: npm publish --access public
24+
env:
25+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.npmignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.git
2+
.github
3+
__pycache__
4+
*.pyc
5+
.DS_Store
6+
requirements.txt
7+
update_sitemap.py

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 LabEx
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
name: '@labex/sitemap',
3+
description: 'A collection of LabEx website sitemaps',
4+
repository: 'https://github.com/labex-labs/labex-sitemap'
5+
};

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "@labex/sitemap",
3+
"version": "1.0.0",
4+
"description": "A collection of LabEx website sitemaps",
5+
"main": "index.js",
6+
"files": [
7+
"sitemaps",
8+
"README.md"
9+
],
10+
"scripts": {
11+
"test": "echo \"No test specified\""
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/labex-labs/labex-sitemap.git"
16+
},
17+
"keywords": [
18+
"labex",
19+
"sitemap",
20+
"learning",
21+
"education"
22+
],
23+
"author": "LabEx",
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/labex-labs/labex-sitemap/issues"
27+
},
28+
"homepage": "https://github.com/labex-labs/labex-sitemap#readme",
29+
"publishConfig": {
30+
"access": "public"
31+
}
32+
}

0 commit comments

Comments
 (0)