diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f89671b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release + +# Triggered by pushing a version tag (e.g. `v0.1.0`). Runs the same +# lint/typecheck/test/build gate as CI, then packages the built CLI as an +# npm-pack tarball and publishes it as a GitHub Release with +# auto-generated release notes. +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + - run: npm run lint + - run: npm run typecheck + - run: npm test + - run: npm run build + + - name: Package release tarball + run: | + mkdir -p release + npm pack --pack-destination release + mv release/*.tgz "release/ct-cli-${GITHUB_REF_NAME}.tgz" + + - name: Write install note + run: | + cat > release/INSTALL.md <.tgz +ct --help +``` + +(Replace `` with the tag of the release you're installing, e.g. `v0.1.0`.) +Each release also attaches an `INSTALL.md` with the exact command for that tag. + +Every push of a `v*` tag runs lint/typecheck/test/build and publishes the +resulting package as a GitHub Release ([`.github/workflows/release.yml`](.github/workflows/release.yml)). + ## Install (dev) ```bash diff --git a/package.json b/package.json index 812b0c2..d8f11c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ct-cli", - "version": "0.0.0", + "version": "0.1.0", "private": true, "description": "ChurchTools structure-as-code CLI — declarative plan/apply for the overarching, rights-bearing structure (campuses, groups, hierarchies, permissions, auto-groups). Never manages people.", "type": "module",