Nightly Build #98
This file contains hidden or 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: Nightly Build | |
| on: | |
| schedule: | |
| # 每天凌晨2点运行 | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: # 允许手动触发 | |
| jobs: | |
| build: | |
| name: Nightly Build | |
| uses: ./.github/workflows/build-test.yml | |
| with: | |
| test_matrix: '["ubuntu-latest"]' # 夜间构建只需要在ubuntu上测试 | |
| secrets: inherit | |
| nightly: | |
| name: Nightly Tasks | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js and pnpm | |
| uses: ./.github/actions/setup-node-pnpm | |
| - name: Generate build info | |
| run: | | |
| echo "Build Date: $(date)" > build-info.txt | |
| echo "Commit: ${{ github.sha }}" >> build-info.txt | |
| echo "Branch: ${{ github.ref_name }}" >> build-info.txt | |
| echo "Node Version: $(node --version)" >> build-info.txt | |
| echo "pnpm Version: $(pnpm --version)" >> build-info.txt | |
| - name: Upload nightly build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vscode-syncing-nightly-${{ github.sha }} | |
| path: | | |
| *.vsix | |
| dist/ | |
| build-info.txt | |
| retention-days: 30 | |
| - name: Check for security vulnerabilities | |
| run: | | |
| echo "🔒 Running security audit..." | |
| pnpm audit --audit-level moderate || echo "⚠️ Security vulnerabilities found" | |
| - name: Check for outdated dependencies | |
| run: | | |
| echo "📦 Checking for outdated dependencies..." | |
| pnpm outdated || echo "✅ All dependencies are up to date" | |
| - name: Generate dependency report | |
| run: | | |
| echo "# Dependency Report" > dependency-report.md | |
| echo "Generated on: $(date)" >> dependency-report.md | |
| echo "" >> dependency-report.md | |
| echo "## Outdated Dependencies" >> dependency-report.md | |
| pnpm outdated >> dependency-report.md 2>&1 || echo "All dependencies are up to date" >> dependency-report.md | |
| echo "" >> dependency-report.md | |
| echo "## Security Audit" >> dependency-report.md | |
| pnpm audit --audit-level moderate >> dependency-report.md 2>&1 || echo "No security issues found" >> dependency-report.md | |
| - name: Upload dependency report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dependency-report-${{ github.sha }} | |
| path: dependency-report.md | |
| retention-days: 30 |