Repository navigation
fix(telemetry): fingerprint coded errors by code, name the blocked-on… #749
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" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| check-package-version: | |
| name: Check package version and detect an update | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| outputs: | |
| committed-version: ${{ steps.check-package-version.outputs.committed-version }} | |
| published-version: ${{ steps.check-package-version.outputs.published-version }} | |
| is-new-version: ${{ steps.check-package-version.outputs.is-new-version }} | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - name: Check package version and detect an update | |
| id: check-package-version | |
| uses: PostHog/check-package-version@97f76f610f6c3d259e2eac4f2783adbb84ac8493 # v2.0.1 | |
| release: | |
| name: Publish release if new version | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 10 | |
| needs: check-package-version | |
| if: needs.check-package-version.outputs.is-new-version == 'true' | |
| env: | |
| COMMITTED_VERSION: ${{ needs.check-package-version.outputs.committed-version }} | |
| PUBLISHED_VERSION: ${{ needs.check-package-version.outputs.published-version }} | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
| with: | |
| node-version-file: 'package.json' | |
| registry-url: https://registry.npmjs.org | |
| - name: Install pnpm | |
| run: npm install -g pnpm@10.34.5 | |
| - name: Install package.json dependencies with pnpm | |
| run: pnpm install --frozen-lockfile | |
| - name: Build the package | |
| run: pnpm build | |
| - name: Publish the package in the npm registry | |
| run: pnpm publish --access public | |
| - name: Notify Slack of npm publish | |
| uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_WIZARD_RELEASES }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": ":rocket: wizard *<https://github.com/${{ github.repository }}/releases/tag/v${{ env.COMMITTED_VERSION }}|v${{ env.COMMITTED_VERSION }}>* released to *<https://www.npmjs.com/package/@posthog/wizard/v/${{ env.COMMITTED_VERSION }}|npm>*" | |
| } |