@@ -2,41 +2,17 @@ name: Release Agent
22
33on :
44 push :
5- branches :
6- - main
7- workflow_dispatch :
5+ tags :
6+ - " agent-v*"
87
98concurrency :
109 group : agent-release
1110 cancel-in-progress : false
1211
1312jobs :
14- check-package-version :
15- name : Check package version and detect an update
16- runs-on : ubuntu-latest
17- permissions :
18- contents : read
19- outputs :
20- committed-version : ${{ steps.check-package-version.outputs.committed-version }}
21- published-version : ${{ steps.check-package-version.outputs.published-version }}
22- is-new-version : ${{ steps.check-package-version.outputs.is-new-version }}
23- steps :
24- - name : Checkout repository
25- uses : actions/checkout@v6
26- with :
27- persist-credentials : false
28-
29- - name : Check package version and detect an update
30- id : check-package-version
31- uses : PostHog/check-package-version@v2
32- with :
33- path : packages/agent
34-
3513 release :
36- name : Publish release if new version
14+ name : Publish agent to npm
3715 runs-on : ubuntu-latest
38- needs : check-package-version
39- if : needs.check-package-version.outputs.is-new-version == 'true'
4016 permissions :
4117 contents : read
4218 id-token : write
5632 cache : " pnpm"
5733 registry-url : https://registry.npmjs.org
5834
35+ - name : Extract version from tag
36+ id : version
37+ run : |
38+ TAG_VERSION="${GITHUB_REF#refs/tags/agent-v}"
39+ echo "Version: $TAG_VERSION"
40+ echo "version=$TAG_VERSION" >> "$GITHUB_OUTPUT"
41+
42+ - name : Set version in package.json
43+ env :
44+ APP_VERSION : ${{ steps.version.outputs.version }}
45+ run : |
46+ jq --arg v "$APP_VERSION" '.version = $v' packages/agent/package.json > tmp.json && mv tmp.json packages/agent/package.json
47+ echo "Set packages/agent/package.json version to $APP_VERSION"
48+
5949 - name : Install dependencies
6050 run : pnpm install --frozen-lockfile
6151
7666
7767 - name : Publish the package to npm registry
7868 working-directory : packages/agent
79- run : pnpm publish --access public
69+ run : pnpm publish --access public --no-git-checks
8070 env :
8171 NPM_CONFIG_PROVENANCE : true
8272 NODE_AUTH_TOKEN : ' '
0 commit comments