Generio Library Release Workflow

Job-specific release process for the generio-ai/library-legacy package (formerly generio-ai/base). Owned by the generio project.

Source: raw/generio-work/git workflow for library-legacy.md.

A. Publish a new version (from main)

git fetch origin
git switch main
git pull --ff-only origin main
npm ci
npm pkg get name version
npm run build
npm publish --dry-run
export NODE_AUTH_TOKEN=''
npm whoami --registry=https://npm.pkg.github.com
npm publish

Publishing to the GitHub Package Registry (npm.pkg.github.com) — needs NODE_AUTH_TOKEN.

B. Promote main → test (fast-forward)

  1. Start a feature branch from latest main:
    git fetch origin
    git switch main
    git pull --ff-only origin main
    git switch -c fix/performance-improve
  2. Commit + push + open PR to main:
    git add .
    git commit -m "fix: improve performance"
    git push -u origin fix/performance-improve
    gh pr create --base main --head fix/performance-improve --title "fix: improve performance"
    Merge the PR into main.
  3. Fast-forward test to updated main:
    git fetch origin
    git switch test
    git pull --ff-only origin test
    git merge --ff-only origin/main
    git push origin test
    git merge --ff-only stops safely if test has commits not in main. Pushing test triggers the test build/deploy.

Cleanup

git switch main
git branch -d fix/performance-improve
git push origin --delete fix/performance-improve

Recover from wrong branch (stash)

git stash push -u -m "fix: <commit-message>"
git fetch origin
git switch main
git pull --ff-only origin main
git switch -c fix/branch-name
git stash pop
git commit -m "fix: <commit-message>"
git push -u origin fix/branch-name

Open questions

  • Why test is a long-lived branch promoted by fast-forward rather than its own PRs.
  • CI/CD triggers behind the test push.