Skip to content

Commit 2d1cbba

Browse files
authored
Merge pull request #141 from currents-dev/maxi/eng-543-enable-linear-release-process-for-currentscmd-package
chore: integrate Linear Releases with CI/CD pipeline
2 parents 50bd12b + fb8e99a commit 2d1cbba

4 files changed

Lines changed: 93 additions & 1 deletion

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Linear Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "release/**"
8+
9+
jobs:
10+
linear-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
# Main branch: sync without --release-version (targets current started release)
18+
- uses: linear/linear-release-action@v0
19+
if: github.event_name == 'push' && !startsWith(github.ref_name, 'release/')
20+
with:
21+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
22+
23+
# Release branch: derive version from branch name
24+
- name: Set release version
25+
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/')
26+
run: echo "RELEASE_VERSION=${GITHUB_REF_NAME#release/}" >> "$GITHUB_ENV"
27+
28+
# Release branch: sync with explicit version
29+
- uses: linear/linear-release-action@v0
30+
if: github.event_name == 'push' && startsWith(github.ref_name, 'release/')
31+
with:
32+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
33+
version: ${{ env.RELEASE_VERSION }}
34+

.github/workflows/publish.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
node-version: "24.x"
3737
registry-url: "https://registry.npmjs.org"
3838

39+
- name: Extract package version
40+
id: extract_version
41+
run: |
42+
PACKAGE_VERSION=$(node -p "require('./package.json').version")
43+
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
44+
3945
- name: Update npm to support Trusted Publishing
4046
run: npm install -g npm@latest
4147

@@ -46,4 +52,32 @@ jobs:
4652
git config user.email "npm@currents.dev"
4753
npm run publish:mcp -- -- --tag ${{ github.event.inputs.channel }}
4854
55+
- name: Mark Linear release as complete
56+
id: release
57+
if: success() && github.event.inputs.channel == 'latest'
58+
uses: linear/linear-release-action@v0
59+
with:
60+
access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
61+
command: complete
62+
version: ${{ steps.extract_version.outputs.package_version }}
63+
64+
- name: Post to Slack
65+
if: success() && github.event.inputs.channel == 'latest' && steps.release.outputs.release-url
66+
uses: slackapi/slack-github-action@v2
67+
with:
68+
webhook: ${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}
69+
webhook-type: incoming-webhook
70+
payload: |
71+
{
72+
"text": "🚀 Release: @currents/mcp@${{ steps.extract_version.outputs.package_version }}",
73+
"blocks": [
74+
{
75+
"type": "section",
76+
"text": {
77+
"type": "mrkdwn",
78+
"text": "*Release: ${{ steps.extract_version.outputs.package_version }}* has been marked as complete in Linear.\n\n<${{ steps.release.outputs.release-url }}|View Release Notes>"
79+
}
80+
}
81+
]
82+
}
4983

RELEASE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ This separation allows for testing releases before publishing and supports multi
2020

2121
Releases are created via GitHub Actions or locally using [release-it](https://github.com/release-it/release-it) with conventional commits.
2222

23+
Before starting the release process, create a release branch following the `release/VERSION` convention. For example, if you're releasing version 2.3.0, create a branch named `release/2.3.0`. This branch will automatically trigger the Linear Release workflow.
24+
25+
```bash
26+
git checkout -b release/2.3.0
27+
git push -u origin release/2.3.0
28+
```
29+
2330
### Steps
2431

2532
1. Go to **Actions****Create Release**
@@ -101,6 +108,23 @@ The workflow will:
101108

102109
This is useful when you've tested a beta release and want to make it the default install without rebuilding.
103110

111+
## Linear Release
112+
113+
The repository follows a branch-cut release model with Linear Releases integration:
114+
115+
1. **Main branch** — collects new features and changes
116+
2. **Release branch creation** — when a `release/*` branch is pushed, it automatically:
117+
- Syncs with Linear Release
118+
3. **Stabilization** — only bug fixes and critical changes are allowed on the release branch
119+
4. **Publishing** — when publishing to npm via the "Publish NPM Package" workflow with `latest` channel, the release is automatically marked as completed in Linear and posted to Slack
120+
121+
The workflow is defined in `.github/workflows/linear-release.yaml` and syncs the release state between Git branches and Linear Releases.
122+
123+
**Required secrets:**
124+
125+
- `LINEAR_ACCESS_KEY` — pipeline-scoped access key (generated from Linear pipeline settings)
126+
- `SLACK_RELEASE_WEBHOOK_URL` — Slack incoming webhook for posting messages
127+
104128
## Local Development
105129

106130
### Dry Run Release Locally

mcp-server/.release-it.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"commitMessage": "chore: release v${version}",
44
"tagName": "v${version}",
55
"requireCleanWorkingDir": true,
6-
"requireBranch": ["main", "release/*"]
6+
"requireBranch": ["release/*"]
77
},
88
"github": {
99
"release": true,

0 commit comments

Comments
 (0)