fix: If an update is already downloaded and waiting, emit the Ready e… #198
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 Agent | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: agent-release | |
| cancel-in-progress: false | |
| jobs: | |
| check-package-version: | |
| name: Check package version and detect an update | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| 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 repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Check package version and detect an update | |
| id: check-package-version | |
| uses: PostHog/check-package-version@v2 | |
| with: | |
| path: packages/agent | |
| release: | |
| name: Publish release if new version | |
| runs-on: ubuntu-latest | |
| needs: check-package-version | |
| if: needs.check-package-version.outputs.is-new-version == 'true' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Set up Node 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: "pnpm" | |
| registry-url: https://registry.npmjs.org | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build the package | |
| run: pnpm --filter agent run build | |
| - name: Run tests | |
| run: pnpm --filter agent run test | |
| - name: Publish the package to npm registry | |
| working-directory: packages/agent | |
| run: pnpm publish --access public |