Skip to content

Commit b89cd41

Browse files
Reorganize examples into folders with READMEs (#42)
* Reorganize examples into folders with READMEs Move each CI example into its own directory with a platform-conventional filename and a README explaining when to use it, how it works, and setup steps. Update SKILL.md links to point to the new folder paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix inaccurate customization guidance in READMEs - GitLab CI continuous: clarify that $CI_DEFAULT_BRANCH is a predefined variable and show how to replace it in the rule expression - GitHub Actions scheduled: note that branch pattern changes must also update startsWith() guards and version derivation in the workflow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Rework docs * Rename example files to platform conventions Use the filename each CI platform expects: `linear-release.yml` for GitHub Actions workflows, `config.yml` for CircleCI, `.gitlab-ci.yml` for GitLab CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c094f20 commit b89cd41

13 files changed

Lines changed: 188 additions & 12 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# CircleCI — Continuous Pipeline
2+
3+
Every deployment creates a completed release automatically.
4+
5+
## When to use
6+
7+
Use this when your team ships continuously — every push to main is a deploy, and each deploy should be tracked as its own release in Linear.
8+
9+
## How it works
10+
11+
On every push to `main`, the workflow downloads the Linear Release CLI and runs `sync`. This creates a new release from the commits since the last release and immediately marks it as complete.
12+
13+
## Setup
14+
15+
1. Create a release pipeline in Linear (Settings → Releases) and grab the access key.
16+
2. Add `LINEAR_ACCESS_KEY` as an environment variable in CircleCI (Project Settings → Environment Variables).
17+
3. Copy the contents of [`config.yml`](config.yml) into your `.circleci/config.yml` (or merge with your existing config).
18+
19+
## Customization
20+
21+
- **Branch name**: Change `main` in the branch filter if your default branch is different.
22+
- **Monorepo path filters**: Add `--include-paths` to the `sync` command to scope the release to specific directories.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# CircleCI — Scheduled Pipeline
2+
3+
Releases follow a branch cut model where changes collect over time and move through stages before shipping.
4+
5+
## When to use
6+
7+
Use this when your team cuts release branches for stabilization. Main collects changes into the current release, release branches sync with an explicit version and auto-promote on creation.
8+
9+
## How it works
10+
11+
- **Push to `main`**: Syncs issues to the current started release (no explicit version).
12+
- **Push to `release/*`**: Derives the version from `CIRCLE_BRANCH` and syncs with that version. Detects branch creation by checking for previous pipelines via the CircleCI API, and auto-promotes to "code freeze" on first push.
13+
- **API trigger**: Runs `update` or `complete` with pipeline parameters for later stage transitions and final completion.
14+
15+
### Triggering manual actions
16+
17+
Use the CircleCI API to trigger stage transitions:
18+
19+
```bash
20+
curl -X POST https://circleci.com/api/v2/project/gh/ORG/REPO/pipeline \
21+
-H "Circle-Token: $CIRCLE_TOKEN" -H "Content-Type: application/json" \
22+
-d '{"parameters": {"run-release-action": true, "action": "update", "stage": "qa", "release_version": "1.2.0"}}'
23+
```
24+
25+
## Setup
26+
27+
1. Create a release pipeline in Linear (Settings → Releases) and grab the access key.
28+
2. Add `LINEAR_ACCESS_KEY` and `CIRCLE_TOKEN` as environment variables in CircleCI (Project Settings → Environment Variables).
29+
3. Copy the contents of [`config.yml`](config.yml) into your `.circleci/config.yml` (or merge with your existing config).
30+
31+
## Customization
32+
33+
- **Branch patterns**: Change `release/` to match your release branch convention.
34+
- **Stage names**: Replace `code freeze` with whatever your first stage is called.
35+
- **Version derivation**: The example strips `release/` from the branch name. Adjust if your branch naming differs.
36+
- **Monorepo path filters**: Add the `include_paths` input to scope the release to specific directories.
37+
38+
## Monorepo note
39+
40+
CircleCI doesn't support path filtering natively. Use the `path-filtering` orb or split into separate workflows and use the API to conditionally trigger.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
# release branches derive version from CIRCLE_BRANCH.
55
#
66
# Trigger: Auto on push, API trigger for later stage transitions and completion.
7-
# Customize: Branch patterns, stage names, auto-promotion stage.
7+
# Customize: Branch patterns, stage names, auto-promotion stage, path inclusion.
88
# Note: Set LINEAR_ACCESS_KEY and CIRCLE_TOKEN in CircleCI project settings.
99
#
1010
# Branch creation detection: CircleCI has no built-in signal, so auto-promotion
1111
# checks the API for previous pipelines on the branch.
12-
#
13-
# Monorepo: CircleCI doesn't support path filtering natively. Use the `path-filtering`
14-
# orb or split into separate workflows and use the API to conditionally trigger.
1512

1613
version: 2.1
1714

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# GitHub Actions — Continuous Pipeline
2+
3+
Every deployment creates a completed release automatically.
4+
5+
## When to use
6+
7+
Use this when your team ships continuously — every push to main is a deploy, and each deploy should be tracked as its own release in Linear.
8+
9+
## How it works
10+
11+
On every push to `main`, the workflow runs `sync` via the official [Linear Release Action](https://github.com/linear/linear-release-action). This creates a new release from the commits since the last release and immediately marks it as complete.
12+
13+
## Setup
14+
15+
1. Create a release pipeline in Linear (Settings → Releases) and grab the access key.
16+
2. Add `LINEAR_ACCESS_KEY` as a repository secret (Settings → Secrets and variables → Actions → New repository secret).
17+
3. Copy [`linear-release.yml`](linear-release.yml) into `.github/workflows/`.
18+
19+
## Customization
20+
21+
- **Branch name**: Change `main` in the `branches` filter if your default branch is different.
22+
- **Monorepo path filters**: Add the `include_paths` input to scope the release to specific directories.
File renamed without changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# GitHub Actions — Scheduled Pipeline
2+
3+
Releases follow a branch cut model where changes collect over time and move through stages before shipping.
4+
5+
## When to use
6+
7+
Use this when your team cuts release branches for stabilization. Main collects changes into the current release, a `release/*` branch is cut for stabilization, and branch creation auto-promotes to "code freeze".
8+
9+
## How it works
10+
11+
- **Push to `main`**: Syncs issues to the current started release (no explicit version).
12+
- **Push to `release/*`**: Derives the version from the branch name and syncs with that version. On branch creation, auto-promotes the release to "code freeze".
13+
- **Manual dispatch**: Runs `update` or `complete` with the specified stage and version, for later stage transitions and final completion.
14+
15+
## Setup
16+
17+
1. Create a release pipeline in Linear (Settings → Releases) and grab the access key.
18+
2. Add `LINEAR_ACCESS_KEY` as a repository secret (Settings → Secrets and variables → Actions → New repository secret).
19+
3. Copy [`linear-release.yml`](linear-release.yml) into `.github/workflows/`.
20+
21+
## Customization
22+
23+
- **Branch patterns**: Change `release/**` in the push trigger _and_ update every `startsWith(github.ref_name, 'release/')` guard and the `${GITHUB_REF_NAME#release/}` version derivation in the workflow to match your release branch convention.
24+
- **Stage names**: Replace `code freeze` with whatever your first stage is called.
25+
- **Version derivation**: The example strips `release/` from the branch name. Adjust if your branch naming differs.
26+
27+
## Monorepo note
28+
29+
GitHub Actions `paths` applies to all branches in a push trigger. To path-filter `main` without filtering release branches, split into two workflow files:
30+
31+
1. **File 1 (main)**: Add `paths: [...]` to the push trigger, keep only the main sync step.
32+
2. **File 2 (release)**: Keep the release branch + `workflow_dispatch` logic as-is.
33+
34+
Add `include_paths` to the action in both files.
File renamed without changes.
File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# GitLab CI — Continuous Pipeline
2+
3+
Every deployment creates a completed release automatically.
4+
5+
## When to use
6+
7+
Use this when your team ships continuously — every push to the default branch is a deploy, and each deploy should be tracked as its own release in Linear.
8+
9+
## How it works
10+
11+
On every push to the default branch, the job downloads the Linear Release CLI and runs `sync`. This creates a new release from the commits since the last release and immediately marks it as complete.
12+
13+
## Setup
14+
15+
1. Create a release pipeline in Linear (Settings → Releases) and grab the access key.
16+
2. Add `LINEAR_ACCESS_KEY` as a CI/CD variable in GitLab (Settings → CI/CD → Variables).
17+
3. Copy the contents of [`.gitlab-ci.yml`](.gitlab-ci.yml) into your `.gitlab-ci.yml` (or merge with your existing config).
18+
19+
## Customization
20+
21+
- **Branch rules**: The workflow uses GitLab's predefined `$CI_DEFAULT_BRANCH` variable, which automatically matches your repository's default branch. To target a different branch, replace `$CI_DEFAULT_BRANCH` in the rule expression with a hardcoded branch name (e.g. `if: $CI_COMMIT_BRANCH == "production"`).
22+
- **Monorepo path filters**: Add `--include-paths` to the `sync` command to scope the release to specific directories.

0 commit comments

Comments
 (0)