Skip to content

chore: release v1.0.5-beta.4 #15

chore: release v1.0.5-beta.4

chore: release v1.0.5-beta.4 #15

Workflow file for this run

# This action will publish the package to npm and create a GitHub release.
name: Release
on:
# Run `npm run bump` to bump the version and create a git tag.
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.14.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.20.0
registry-url: 'https://registry.npmjs.org'
scope: '@winner-fed'
always-auth: true
- name: Update npm to latest
run: npm install -g npm@latest
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Verify package.json
run: |
echo "Package name: $(node -p "require('./package.json').name")"
echo "Package version: $(node -p "require('./package.json').version")"
- name: Debug npm config
run: |
echo "=== npm 配置信息 ==="
npm config list
echo ""
echo "=== 环境变量检查 ==="
echo "NODE_AUTH_TOKEN exists: $([ -n "$NODE_AUTH_TOKEN" ] && echo 'yes' || echo 'no')"
echo "NPM_TOKEN exists: $([ -n "$NPM_TOKEN" ] && echo 'yes' || echo 'no')"
echo ""
echo "=== npm 版本信息 ==="
npm --version
echo ""
echo "=== 检查 .npmrc 文件 ==="
cat ~/.npmrc 2>/dev/null || echo "未找到 .npmrc 文件"
echo ""
echo "=== 检查 npm 认证状态 ==="
npm whoami || echo "未认证或认证失败"
echo ""
echo "=== 检查作用域配置 ==="
npm config get @winner-fed:registry || echo "未找到作用域配置"
echo ""
echo "=== 检查认证 token 格式 ==="
if [ -n "$NODE_AUTH_TOKEN" ]; then
echo "Token 长度: ${#NODE_AUTH_TOKEN}"
echo "Token 前缀: ${NODE_AUTH_TOKEN:0:20}..."
fi
- name: Publish to npm
run: npm publish --access public --provenance
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: "true"