feat: 新增类型文件 #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to NPM on Main Push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: 设置 Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org/" | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: 全局安装 typescript | |
run: npm install -g typescript | |
- name: 编译index.ts | |
run: tsc | |
- name: 全局安装 protobufjs-cli | |
run: npm install -g protobufjs-cli | |
- name: 编译 proto | |
run: npm run build | |
- name: 推送到 npm | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |