Publish to npm #12
Workflow file for this run
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: Publish to npm | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| name: Publish to npm | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Publish to npm | |
| run: npm publish | |
| publish-report: | |
| name: Publish test report to GitHub Pages | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| if: always() | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download all test reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: test-report-* | |
| path: test-reports | |
| - name: Prepare test reports for upload | |
| run: | | |
| BRANCH_NAME="${GITHUB_REF#refs/heads/}" | |
| BRANCH_DIR="${BRANCH_NAME}" | |
| mkdir -p "${BRANCH_DIR}" | |
| # Copy the latest SQL Server version report as the main report | |
| cp test-reports/test-report-2022-latest/test-report.json "${BRANCH_DIR}/test_report.json" | |
| # Also copy individual reports for each SQL Server version | |
| for version_dir in test-reports/test-report-*/; do | |
| version=$(basename "${version_dir}" | sed 's/test-report-//') | |
| cp "${version_dir}/test-report.json" "${BRANCH_DIR}/test_report_${version}.json" | |
| done | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: . | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |