Skip to content

fix ci

fix ci #86

Workflow file for this run

name: Node.js Package
on:
push:
tags:
- '*'
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read # 允许读取仓库代码
id-token: write
steps:

Check failure on line 14 in .github/workflows/npm-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/npm-publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 14
- name: Debug OIDC Token
run: |
echo "ACTIONS_ID_TOKEN_REQUEST_URL: $ACTIONS_ID_TOKEN_REQUEST_URL"
echo "ACTIONS_ID_TOKEN_REQUEST_TOKEN: $ACTIONS_ID_TOKEN_REQUEST_TOKEN"
# 尝试获取令牌(仅调试用)
ID_TOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://registry.npmjs.org/" \
| jq -r '.value')
echo "ID_TOKEN exists: $([ -n "$ID_TOKEN" ] && echo "Yes" || echo "No")"
env:
ACTIONS_ID_TOKEN_REQUEST_URL: ${{ env.ACTIONS_ID_TOKEN_REQUEST_URL }}
ACTIONS_ID_TOKEN_REQUEST_TOKEN: ${{ env.ACTIONS_ID_TOKEN_REQUEST_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Publish
run: |
npm i
version=`git describe --tags`
sed -i "s/0.0.0-version-placeholder/$version/g" ./projects/sim-api/package.json
sed -i "s/0.0.0/$version/g" ./projects/sim-api/src/version.ts
npm run -- ng build SimApi -c production
npm publish ./dist/sim-api --provenance --access public