Skip to content

Commit a3bb333

Browse files
committed
Initial commit
0 parents  commit a3bb333

29 files changed

Lines changed: 4063 additions & 0 deletions

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Required: Pipeline access key from Linear
2+
LINEAR_ACCESS_KEY=lin_access_xxxxxxxxxxxxxxxxxxxxx

.github/workflows/release.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build executable for ${{ matrix.os }}-${{ matrix.arch }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
arch: x64
18+
platform: linux-x64
19+
target: bun-linux-x64
20+
- os: macos-latest
21+
arch: x64
22+
platform: darwin-x64
23+
target: bun-darwin-x64
24+
- os: macos-latest
25+
arch: arm64
26+
platform: darwin-arm64
27+
target: bun-darwin-arm64
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # Full history needed for git operations
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: "22.22"
39+
40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v4
42+
with:
43+
version: 10.22.0
44+
45+
- name: Setup Bun
46+
uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: latest
49+
50+
- name: Install dependencies
51+
run: pnpm install
52+
53+
- name: Build executable
54+
run: |
55+
VERSION=$(node -p "require('./package.json').version")
56+
NODE_ENV=production bun build --compile --target=${{ matrix.target }} \
57+
--define "CLI_VERSION='$VERSION'" \
58+
src/index.ts --outfile=./bin/linear-release
59+
60+
- name: Code sign macOS executable
61+
if: matrix.os == 'macos-latest'
62+
run: |
63+
codesign --force --deep --sign - ./bin/linear-release || true
64+
65+
- name: Upload artifact
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: linear-release-${{ matrix.platform }}
69+
path: bin/linear-release*
70+
retention-days: 7
71+
72+
release:
73+
name: Create Release
74+
needs: build
75+
runs-on: ubuntu-latest
76+
if: startsWith(github.ref, 'refs/tags/')
77+
permissions:
78+
contents: write
79+
80+
steps:
81+
- name: Checkout code
82+
uses: actions/checkout@v4
83+
with:
84+
fetch-depth: 0
85+
86+
- name: Download all artifacts
87+
uses: actions/download-artifact@v4
88+
with:
89+
path: ./artifacts
90+
91+
- name: List artifacts
92+
run: |
93+
find ./artifacts -type f
94+
ls -la ./artifacts/
95+
96+
- name: Extract tag name
97+
id: tag
98+
run: |
99+
TAG_NAME=${GITHUB_REF#refs/tags/}
100+
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
101+
echo "Tag name: $TAG_NAME"
102+
103+
- name: Prepare release files
104+
run: |
105+
mkdir -p ./release-files
106+
# Copy each platform's executable with platform-specific name
107+
for dir in ./artifacts/linear-release-*/; do
108+
platform=$(basename "$dir" | sed 's/linear-release-//')
109+
if [ -f "$dir/linear-release" ]; then
110+
cp "$dir/linear-release" "./release-files/linear-release-${platform}"
111+
elif [ -f "$dir/linear-release.exe" ]; then
112+
cp "$dir/linear-release.exe" "./release-files/linear-release-${platform}.exe"
113+
fi
114+
done
115+
ls -la ./release-files/
116+
117+
- name: Create Release
118+
uses: softprops/action-gh-release@v2
119+
with:
120+
tag_name: ${{ steps.tag.outputs.tag_name }}
121+
name: Release ${{ steps.tag.outputs.tag_name }}
122+
files: |
123+
./release-files/*
124+
generate_release_notes: true
125+
token: ${{ secrets.GITHUB_TOKEN }}
126+
draft: false
127+
prerelease: false
128+
129+
complete-release:
130+
name: Complete release
131+
needs: release
132+
uses: ./.github/workflows/run-linear-release.yml
133+
with:
134+
action: complete
135+
secrets: inherit
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Run Release Management
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
action:
7+
description: "Action to perform"
8+
required: true
9+
type: string
10+
11+
workflow_dispatch:
12+
inputs:
13+
action:
14+
description: "Action"
15+
required: true
16+
type: choice
17+
options:
18+
- sync
19+
- complete
20+
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
sync:
26+
name: Sync issues to release
27+
if: inputs.action == 'sync'
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Download CLI
35+
env:
36+
GH_TOKEN: ${{ github.token }}
37+
run: gh release download --repo linear/linear-release --pattern "linear-release-linux-x64" --output linear-release
38+
39+
- name: Sync issues
40+
env:
41+
LINEAR_ACCESS_KEY: ${{ secrets.LINEAR_RELEASE_MANAGEMENT_ACCESS_KEY }}
42+
run: |
43+
chmod +x linear-release
44+
./linear-release sync
45+
46+
complete:
47+
name: Complete release
48+
if: inputs.action == 'complete'
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
55+
- name: Download CLI
56+
env:
57+
GH_TOKEN: ${{ github.token }}
58+
run: gh release download --repo linear/linear-release --pattern "linear-release-linux-x64" --output linear-release
59+
60+
- name: Complete release
61+
env:
62+
LINEAR_ACCESS_KEY: ${{ secrets.LINEAR_RELEASE_MANAGEMENT_ACCESS_KEY }}
63+
run: |
64+
chmod +x linear-release
65+
./linear-release complete

.github/workflows/test.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: "22"
22+
23+
- uses: pnpm/action-setup@v4
24+
with:
25+
version: 10.22.0
26+
27+
- run: pnpm install
28+
29+
- run: pnpm fmt:check
30+
31+
- run: pnpm lint
32+
33+
- run: pnpm typecheck
34+
35+
- run: pnpm test:ci
36+
37+
sync-release:
38+
name: Sync release management
39+
needs: test
40+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
41+
uses: ./.github/workflows/run-linear-release.yml
42+
with:
43+
action: sync
44+
secrets: inherit

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# macOS
2+
.DS_Store
3+
.AppleDouble
4+
.LSOverride
5+
Icon?
6+
._*
7+
.Spotlight-V100
8+
.Trashes
9+
10+
# Node dependencies
11+
node_modules/
12+
13+
# Builds and output
14+
dist/
15+
build/
16+
bin/
17+
coverage/
18+
.nyc_output/
19+
20+
# Logs
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
pnpm-debug.log*
25+
logs/
26+
*.log
27+
28+
# Env files
29+
.env
30+
.env.local
31+
.env.development.local
32+
.env.test.local
33+
.env.production.local
34+
35+
# Editor / IDE
36+
.vscode/
37+
.idea/
38+
.claude/
39+
*.swp
40+
*.swo
41+
42+
# TypeScript
43+
*.tsbuildinfo
44+

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.22.0

.oxfmtrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["dist", "bin"],
4+
"printWidth": 120
5+
}

.oxlintrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": [],
4+
"categories": {},
5+
"rules": {},
6+
"settings": {
7+
"vitest": {
8+
"typecheck": false
9+
}
10+
},
11+
"env": {
12+
"builtin": true
13+
},
14+
"globals": {},
15+
"ignorePatterns": ["dist", "bin"]
16+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Linear
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)