Fix prepublishOnly: remove pytest dependency from CI publish #1
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: Release Dashboard | |
| on: | |
| push: | |
| tags: ['dashboard-v*'] | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.extract.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - id: extract | |
| name: Extract and validate version | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/dashboard-v}" | |
| PKG=$(node -p "require('./dashboard/package.json').version") | |
| echo "version=$TAG" >> "$GITHUB_OUTPUT" | |
| if [ "$TAG" != "$PKG" ]; then | |
| echo "::error::Tag dashboard-v${TAG} does not match dashboard/package.json version ${PKG}" | |
| exit 1 | |
| fi | |
| publish-and-release: | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: dashboard | |
| - name: Run tests | |
| run: bun test | |
| working-directory: dashboard | |
| - name: Build SPA | |
| run: bun run build | |
| working-directory: dashboard | |
| - name: Verify package contents | |
| run: npm pack --dry-run | |
| working-directory: dashboard | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 18 | |
| registry-url: https://registry.npmjs.org | |
| - name: Publish to npm | |
| run: npm publish | |
| working-directory: dashboard | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Extract changelog section | |
| id: changelog | |
| run: | | |
| VERSION="${{ needs.validate.outputs.version }}" | |
| NOTES=$(sed -n "/^## v${VERSION}/,/^## v/{ /^## v${VERSION}/d; /^## v/d; p; }" dashboard/CHANGELOG.md) | |
| [ -z "$NOTES" ] && NOTES="Dashboard Release v${VERSION}" | |
| echo "$NOTES" > /tmp/release-notes.md | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION="dashboard-v${{ needs.validate.outputs.version }}" | |
| gh release create "$VERSION" --title "$VERSION" --notes-file /tmp/release-notes.md |