Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
165c643
Remove resolved spec.
lkacenja Jan 6, 2026
ce3a4e8
Remove resolved directory from VCS.
lkacenja Jan 6, 2026
f0a8ac7
Generate Zod models from resolved spec.
lkacenja Jan 6, 2026
c0f1f94
Don't add agent files to .gitignore.
lkacenja Jan 6, 2026
7b2dc58
Add packaging script and templates.
lkacenja Jan 6, 2026
e938bff
Add first attempt at github action.
lkacenja Jan 6, 2026
fec1570
Add swagger commands for ease of use.
lkacenja Jan 7, 2026
907971f
Use npm install for now.
lkacenja Jan 7, 2026
538a728
Generate zod models rather than api clients when building package.
lkacenja Jan 7, 2026
70d14d1
Merge branch 'main' into package-overlays
lkacenja Jan 7, 2026
6e19300
Update the documentation.
lkacenja Jan 7, 2026
2e25036
Return search helper utility.
lkacenja Jan 7, 2026
9955dc5
Merge branch 'main' into package-overlays
lkacenja Jan 12, 2026
7d1536a
Break up spec into domain-based zod models.
lkacenja Jan 12, 2026
c718fa0
Fix overlay finding in github action.
lkacenja Jan 12, 2026
aaad5b3
Add x-domain property for grouping in client generation.
lkacenja Jan 13, 2026
0f3ab7a
Use x-domain property to reduce size of compiled types and remove old…
lkacenja Jan 13, 2026
186e81f
Revert "Use x-domain property to reduce size of compiled types and re…
lkacenja Jan 13, 2026
f933778
Revert "Add x-domain property for grouping in client generation."
lkacenja Jan 13, 2026
c4b7d93
Revert "Fix overlay finding in github action."
lkacenja Jan 13, 2026
770f7ff
Revert "Break up spec into domain-based zod models."
lkacenja Jan 13, 2026
69e58dd
Try a single library approach with the openapi-ts library.
lkacenja Jan 14, 2026
6f96c7b
Build all domains, not just person.
lkacenja Jan 14, 2026
8953e29
Make sure all assets are accessible in package.
lkacenja Jan 14, 2026
225b226
Return search helper to package.
lkacenja Jan 14, 2026
c0379ef
Update documentation.
lkacenja Jan 14, 2026
ed4f9f6
Use token for states in documentation.
lkacenja Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 103 additions & 3 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish State Packages

on:
workflow_dispatch:
inputs:
Expand All @@ -15,9 +16,108 @@ on:
required: true
type: string

push:
tags:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can build packages automatically by tagging a commit with a version or state-version. In the latter case the version will only be applied to the specific state. We can also manually trigger a packaging via the UI.

- 'v*'
- '*-v*'

permissions:
contents: read
packages: write

jobs:
placeholder:
setup:
runs-on: ubuntu-latest
outputs:
states: ${{ steps.determine.outputs.states }}
version: ${{ steps.determine.outputs.version }}
steps:
- uses: actions/checkout@v4

- name: Determine states and version
id: determine
run: |
# Get all available states from overlay directories
ALL_STATES=$(ls -d packages/schemas/openapi/overlays/*/ 2>/dev/null | \
xargs -n1 basename | \
jq -R -s -c 'split("\n") | map(select(length > 0))')

if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# Manual trigger
VERSION="${{ github.event.inputs.version }}"
if [[ "${{ github.event.inputs.state }}" == "all" ]]; then
STATES="$ALL_STATES"
else
STATES='["${{ github.event.inputs.state }}"]'
fi
else
# Tag push
TAG="${GITHUB_REF#refs/tags/}"

if [[ "$TAG" =~ ^v([0-9]+\.[0-9]+\.[0-9]+.*) ]]; then
# Format: v1.0.0 or v1.0.0-beta.1 - publish all states
VERSION="${BASH_REMATCH[1]}"
STATES="$ALL_STATES"
elif [[ "$TAG" =~ ^([a-z]+)-v([0-9]+\.[0-9]+\.[0-9]+.*) ]]; then
# Format: california-v1.0.0 - publish single state
STATE="${BASH_REMATCH[1]}"
VERSION="${BASH_REMATCH[2]}"
STATES="[\"$STATE\"]"
else
echo "::error::Invalid tag format: $TAG. Expected v1.0.0 or state-v1.0.0"
exit 1
fi
fi

echo "states=$STATES" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing states: $STATES at version $VERSION"

publish:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
state: ${{ fromJson(needs.setup.outputs.states) }}

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://npm.pkg.github.com'
scope: '@codeforamerica'

- name: Install dependencies
run: npm install

- name: Build state package
run: |
node packages/clients/scripts/build-state-package.js \
--state=${{ matrix.state }} \
--version=${{ needs.setup.outputs.version }}

- name: Publish to GitHub Packages
working-directory: packages/clients/dist-packages/${{ matrix.state }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

summary:
needs: [setup, publish]
runs-on: ubuntu-latest
if: always()
steps:
- name: Placeholder
run: echo "This workflow is under development. Run from a feature branch to test."
- name: Summary
run: |
echo "## Published Packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Version: ${{ needs.setup.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "States:" >> $GITHUB_STEP_SUMMARY
for state in $(echo '${{ needs.setup.outputs.states }}' | jq -r '.[]'); do
echo "- @codeforamerica/safety-net-${state}@${{ needs.setup.outputs.version }}" >> $GITHUB_STEP_SUMMARY
done
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ node_modules/
package-lock.json
.DS_Store
*.log
.idea

# Generated artifacts (state-specific, regenerate as needed)
generated/
packages/schemas/openapi/resolved/
packages/generated
packages/clients/generated
packages/clients/dist-packages
packages/schemas/openapi/resolved

# Cursor AI working files
cursor/

# Claude Code local settings
.claude/
CLAUDE.md
Agents.md
Loading