Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 <<EOF
# Installing ct ${GITHUB_REF_NAME}

\`\`\`bash
npm install -g ./ct-cli-${GITHUB_REF_NAME}.tgz
\`\`\`

Or directly from the release asset URL:

\`\`\`bash
npm install -g https://github.com/${GITHUB_REPOSITORY}/releases/download/${GITHUB_REF_NAME}/ct-cli-${GITHUB_REF_NAME}.tgz
\`\`\`

Verify with:

\`\`\`bash
ct --help
\`\`\`
EOF

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
release/ct-cli-${{ github.ref_name }}.tgz
release/INSTALL.md
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ Early scaffold. See the [epic (#1)](https://github.com/eqrm/ct-cli/issues/1) and
- Node ≥ 20 (repo pins 22 via `.nvmrc`)
- A ChurchTools **personal login token** (ChurchTools → your user settings)

## Install

Grab the latest tarball from the [Releases page](https://github.com/eqrm/ct-cli/releases/latest)
and install it globally with npm — no clone, no build step:

```bash
npm install -g https://github.com/eqrm/ct-cli/releases/latest/download/ct-cli-<version>.tgz
ct --help
```

(Replace `<version>` 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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading