Files
Axel Niklasson Yun b89cd41f61 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>
2026-04-13 12:41:10 +02:00

84 lines
3.0 KiB
YAML

# Linear Release — GitHub Actions (Scheduled)
#
# Use when: Releases follow a branch cut model. Main collects changes into the
# current release, a release branch is cut for stabilization, and branch creation
# auto-promotes to "code freeze".
#
# Trigger: push to main (sync), push to release/* (sync + auto code freeze on
# creation), or manual workflow_dispatch for later stages and completion.
# Customize: Branch patterns, stage names, version derivation.
#
# Monorepo: GitHub Actions `paths` applies to all branches in a push trigger.
# To path-filter main without filtering release branches, split into two files:
# File 1 (main): add `paths: [...]` to the push trigger, keep only the main sync step.
# File 2 (release): keep the release branch + workflow_dispatch logic as-is.
# Add `include_paths` to the action in both files.
name: Linear Release
on:
push:
branches:
- main
- "release/**"
workflow_dispatch:
inputs:
command:
description: "Release command"
required: true
type: choice
options:
- update
- complete
stage:
description: "Release stage (for update, e.g. qa)"
required: false
type: string
version:
description: "Release version"
required: true
type: string
jobs:
linear-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Main branch: sync without --release-version (targets current started release)
- uses: linear/linear-release-action@v0
if: github.event_name == 'push' && !startsWith(github.ref_name, 'release/')
with:
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
# Release branch: derive version from branch name
- name: Set release version
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/')
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#release/}" >> "$GITHUB_ENV"
# Release branch: sync with explicit version
- uses: linear/linear-release-action@v0
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/')
with:
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
version: ${{ env.RELEASE_VERSION }}
# Branch creation: auto-promote to code freeze
- uses: linear/linear-release-action@v0
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/') && github.event.created
with:
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
command: update
stage: code freeze
version: ${{ env.RELEASE_VERSION }}
# Manual: run the specified action (later stages, completion)
- uses: linear/linear-release-action@v0
if: github.event_name == 'workflow_dispatch'
with:
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
command: ${{ inputs.command }}
stage: ${{ inputs.stage }}
version: ${{ inputs.version }}