Skip to content

Commit 6c1c8c6

Browse files
committed
ci: fix release please
1 parent 7c3207f commit 6c1c8c6

File tree

6 files changed

+719
-56
lines changed

6 files changed

+719
-56
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,3 @@ jobs:
4343

4444
- name: Run E2E tests
4545
run: pnpm test:e2e
46-
47-
release-please:
48-
runs-on: ubuntu-latest
49-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
50-
steps:
51-
- uses: actions/checkout@v4
52-
with:
53-
fetch-depth: 0
54-
55-
- name: Run release-please
56-
uses: googleapis/release-please-action@v4
57-
with:
58-
token: ${{ secrets.GITHUB_TOKEN }}
59-
prerelease: ${{ github.ref == 'refs/heads/develop' }}

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
workflow_call:
8+
9+
jobs:
10+
publish:
11+
if: |
12+
(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'v')) ||
13+
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') ||
14+
(github.event_name == 'workflow_call')
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v4
22+
with:
23+
version: 10.12.1
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
cache-dependency-path: "javascript/pnpm-lock.yaml"
29+
node-version: "24.x"
30+
cache: "pnpm"
31+
registry-url: "https://registry.npmjs.org"
32+
33+
- name: Install dependencies
34+
working-directory: javascript
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Run tests
38+
working-directory: javascript
39+
run: pnpm test:ci
40+
41+
- name: Extract version from tag
42+
id: version
43+
run: |
44+
TAG_NAME="${GITHUB_REF#refs/tags/}"
45+
VERSION="${TAG_NAME#v}"
46+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
47+
48+
- name: Determine dist-tag
49+
id: disttag
50+
run: |
51+
VERSION="${{ steps.version.outputs.version }}"
52+
if [[ "$VERSION" == *"-"* ]]; then
53+
echo "tag=prerelease" >> "$GITHUB_OUTPUT"
54+
else
55+
echo "tag=latest" >> "$GITHUB_OUTPUT"
56+
fi
57+
58+
- name: Publish to npm
59+
run: pnpm publish --no-git-checks --tag ${{ steps.disttag.outputs.tag }}
60+
working-directory: javascript
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release-please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
issues: write # This is important for label creation
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
# Don't use release_created this: https://danwakeem.medium.com/beware-the-release-please-v4-github-action-ee71ff9de151
19+
# releases_created: ${{ steps.release.outputs.releases_created }}
20+
# paths_released: ${{ steps.release.outputs.paths_released }}
21+
release_created: ${{ steps.release.outputs.release_created }}
22+
tag_name: ${{ steps.release.outputs.tag_name }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
- uses: googleapis/release-please-action@v4
28+
id: release
29+
with:
30+
# Use manifest mode for monorepo
31+
config-file: .release-please-config.json
32+
manifest-file: .release-please-manifest.json
33+
34+
# Debug job to echo release-please outputs
35+
debug-outputs:
36+
needs: release-please
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Echo outputs
40+
shell: bash
41+
env:
42+
RELEASE_OUTPUTS: ${{ toJSON(needs.release-please.outputs) }}
43+
run: |
44+
echo "All release-please outputs:"
45+
printf '%s\n' "$RELEASE_OUTPUTS"
46+
47+
# Call the Release workflow as a job
48+
trigger-publish:
49+
if: ${{ needs.release-please.outputs.release_created }}
50+
needs: release-please
51+
uses: ./.github/workflows/publish.yml

.github/workflows/release.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.release-please-config.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"packages": {
3+
".": {
4+
"release-type": "node",
5+
"package-name": "@langwatch/better-agents",
6+
"include-component-in-tag": false,
7+
"include-v-in-tag": true,
8+
"prerelease": true,
9+
"changelog-sections": [
10+
{ "type": "feat", "section": "Features" },
11+
{ "type": "fix", "section": "Bug Fixes" },
12+
{ "type": "chore", "section": "Miscellaneous", "hidden": false },
13+
{ "type": "docs", "section": "Documentation", "hidden": false },
14+
{ "type": "refactor", "section": "Code Refactoring", "hidden": false }
15+
]
16+
}
17+
},
18+
"bootstrap-sha": "cab6ce5f81d3ae3dc4bd33f45c1a78437b6c64c8",
19+
"separate-pull-requests": true,
20+
"sequential-calls": true,
21+
"bump-minor-pre-major": true,
22+
"bump-patch-for-minor-pre-major": true
23+
}

0 commit comments

Comments
 (0)