fix: 更换接口为官方精华接口 #68
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: Release and Publish | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: node | |
default-branch: main | |
# 检出代码 | |
- uses: actions/checkout@v4 | |
if: ${{ steps.release.outputs.release_created }} | |
# 设置 Node.js | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
registry-url: "https://registry.npmjs.org" | |
if: ${{ steps.release.outputs.release_created }} | |
# 安装依赖 | |
- run: npm install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} | |
# 添加node-karin开发依赖 | |
- run: npm install node-karin@latest --save-dev | |
if: ${{ steps.release.outputs.release_created }} | |
# 构建输出 | |
- run: npm run build | |
if: ${{ steps.release.outputs.release_created }} | |
# 安装jq工具 删除开发依赖 | |
- run: sudo apt-get install jq && jq 'del(.devDependencies)' package.json > package.json.tmp && mv package.json.tmp package.json | |
if: ${{ steps.release.outputs.release_created }} | |
# 发布到 npm | |
- run: npm run pub | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} | |
# 二次构建旧版本 | |
- run: npm run icqq | |
if: ${{ steps.release.outputs.release_created }} | |
# 发布到 npm | |
- run: npm run pub | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
if: ${{ steps.release.outputs.release_created }} |