Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowwarmth committed Nov 9, 2024
2 parents 8074a9f + c1c7e31 commit b94e88e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Node.js Package

# 触发工作流程的事件
on:
push:
branches:
- main
- "releases/**"
- dev

# 按顺序运行作业
jobs:
publish-gpr:
# 指定的运行器环境
runs-on: ubuntu-latest
# 设置 node 版本
strategy:
matrix:
node-version: [22]
steps:
# 拉取 github 仓库代码
- uses: actions/checkout@v3
# 设定 node 环境
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# 设置发包 npm 地址仓库
registry-url: https://registry.npmjs.org
# 安装依赖,相当于 npm ci
- name: Install dependencies 📦️
run: npm install
# 执行构建步骤
- name: 构建
run: |
npm run build
# 执行部署
- name: 部署
# 这个 action 会根据配置自动推送代码到指定分支
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
# 指定密钥,即在第一步中设置的
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# 指定推送到的远程分支
BRANCH: build
# 指定构建之后的产物要推送哪个目录的代码
FOLDER: dist
- run: npm publish
env:
# 刚刚设置的 NPM_TOKEN
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
18 changes: 18 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"initConfig": {
"appID": "APPID",
"token": "TOKEN",
"intents": [
"GUILD_MESSAGES",
"DIRECT_MESSAGE"
],
"sandbox": false
},
"databaseConfig": {
"unixsocket": "/run/redis/redis-server.sock"
},
"log_level": "all",
"devEnv": "false",
"executablePath": "",
"cron": "0/1 * * * * ?"
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@
"tsx": "^4.16.2",
"typescript": "^5.5.4",
"yaml": "^2.5.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
}

0 comments on commit b94e88e

Please sign in to comment.