-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (68 loc) · 2.28 KB
/
release.yml
File metadata and controls
81 lines (68 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
on:
push:
tags:
- "v*.*.*"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: "24"
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.3.13
- name: Assert Node.js version
run: node -e "const v=+process.version.slice(1).split('.')[0]; if(v<22)process.exit(1)"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: CI gate
run: bun run ci
- name: Unit tests with coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: bun run test:coverage
- name: Create tarball for GitHub Release
id: pack
run: |
set -euo pipefail
npm pack
tarball=$(find . -maxdepth 1 -name 'rethunk-github-mcp-*.tgz' -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2-)
echo "tarball=${tarball#./}" >> "$GITHUB_OUTPUT"
- name: Publish to GitHub Packages (npm registry)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
node <<'NODE'
const fs = require("node:fs");
const p = JSON.parse(fs.readFileSync("package.json", "utf8"));
p.name = "@rethunk-ai/github-mcp";
p.publishConfig = {
registry: "https://npm.pkg.github.com",
access: "public",
};
fs.writeFileSync("package.json", JSON.stringify(p, null, 2) + "\n");
NODE
{
echo "@rethunk-ai:registry=https://npm.pkg.github.com"
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}"
} > .npmrc
npm publish --access public
- name: Create GitHub Release (official gh CLI, no third-party action)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
gh release create "${GITHUB_REF_NAME}" "${{ steps.pack.outputs.tarball }}" \
--verify-tag \
--generate-notes