Skip to content

Commit 2c36bb6

Browse files
authored
Merge pull request #4 from AgentWorkforce/ci
Add GitHub Actions workflow for automatic npm publishing
2 parents 37f4a7e + bea5321 commit 2c36bb6

3 files changed

Lines changed: 108 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
id-token: write
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
23+
- name: Update npm and configure
24+
run: |
25+
npm install -g npm@latest
26+
echo "npm version: $(npm --version)"
27+
echo "node version: $(node --version)"
28+
echo "OIDC URL set: ${ACTIONS_ID_TOKEN_REQUEST_URL:+yes}"
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build
34+
run: npm run build
35+
36+
- name: Run tests
37+
run: npm run test:run
38+
39+
- name: Check if version changed
40+
id: version
41+
run: |
42+
PACKAGE_NAME=$(jq -r .name package.json)
43+
LOCAL_VERSION=$(jq -r .version package.json)
44+
NPM_VERSION=$(npm view "$PACKAGE_NAME" version 2>/dev/null || echo "0.0.0")
45+
46+
echo "local=$LOCAL_VERSION" >> $GITHUB_OUTPUT
47+
echo "npm=$NPM_VERSION" >> $GITHUB_OUTPUT
48+
49+
if [ "$LOCAL_VERSION" != "$NPM_VERSION" ]; then
50+
echo "changed=true" >> $GITHUB_OUTPUT
51+
echo "Version changed: $NPM_VERSION -> $LOCAL_VERSION"
52+
else
53+
echo "changed=false" >> $GITHUB_OUTPUT
54+
echo "Version unchanged: $LOCAL_VERSION"
55+
fi
56+
57+
- name: Publish to npm
58+
if: steps.version.outputs.changed == 'true'
59+
run: |
60+
# Ensure no auth config exists (let npm use OIDC)
61+
rm -f ~/.npmrc
62+
npm publish --access public --provenance
63+
64+
- name: Create GitHub Release
65+
if: steps.version.outputs.changed == 'true'
66+
uses: softprops/action-gh-release@v2
67+
with:
68+
tag_name: v${{ steps.version.outputs.local }}
69+
name: v${{ steps.version.outputs.local }}
70+
generate_release_notes: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dist/
77
# Test coverage
88
coverage/
99

10+
.npm-cache
11+
1012
# Editor
1113
.vscode/
1214
.idea/

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- GitHub Actions workflow for automatic npm publishing with OIDC trusted publishers
13+
14+
## [0.1.1] - 2025-01-01
15+
16+
### Fixed
17+
18+
- CLI export paths for proper npm package distribution
19+
20+
## [0.1.0] - 2025-01-01
21+
22+
### Added
23+
24+
- Initial release
25+
- `trail` CLI for capturing agent work trajectories
26+
- Core commands: `start`, `status`, `decision`, `complete`, `list`, `show`, `export`
27+
- File system storage backend (`.trajectories/` directory)
28+
- Export formats: markdown, json, timeline, html
29+
- Web viewer with `--open` flag for browser-based viewing
30+
- Trajectory format with chapters, events, decisions, and retrospectives
31+
- Confidence scores for agent self-assessment
32+
- Task source linking (Linear, GitHub Issues, etc.)
33+
34+
[Unreleased]: https://github.com/AgentWorkforce/trajectories/compare/v0.1.1...HEAD
35+
[0.1.1]: https://github.com/AgentWorkforce/trajectories/compare/v0.1.0...v0.1.1
36+
[0.1.0]: https://github.com/AgentWorkforce/trajectories/releases/tag/v0.1.0

0 commit comments

Comments
 (0)