-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (73 loc) · 2.64 KB
/
Copy pathrelease.yml
File metadata and controls
83 lines (73 loc) · 2.64 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
82
83
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install debugger tools
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y clang lldb cmake ninja-build
if ! command -v lldb-dap >/dev/null 2>&1; then
candidate="$(find /usr/bin -maxdepth 1 \( -type f -o -type l \) -name 'lldb-dap-*' | sort -V | tail -n 1)"
if [[ -z "${candidate}" ]]; then
echo "lldb-dap was not installed" >&2
exit 1
fi
sudo ln -s "${candidate}" /usr/local/bin/lldb-dap
fi
lldb-dap --version
- run: npm ci
- run: npm audit
- run: npm run verify
- name: Validate tag version
id: version
shell: bash
run: |
version="$(node -p "require('./package.json').version")"
expected_tag="v${version}"
if [[ "${GITHUB_REF_NAME}" != "${expected_tag}" ]]; then
echo "Tag ${GITHUB_REF_NAME} does not match package version ${version}" >&2
exit 1
fi
echo "version=${version}" >> "${GITHUB_OUTPUT}"
echo "filename=cpp-debugger-cli-${version}.tgz" >> "${GITHUB_OUTPUT}"
- name: Build release package
id: package
shell: bash
run: |
filename="$(npm pack --silent)"
expected="${{ steps.version.outputs.filename }}"
if [[ "${filename}" != "${expected}" ]]; then
echo "Expected ${expected}, got ${filename}" >&2
exit 1
fi
tar -tzf "${filename}" | grep -Fx "package/dist/cli.js"
tar -tzf "${filename}" | grep -Fx "package/package.json"
tar -tzf "${filename}" | grep -Fx "package/README.md"
tar -tzf "${filename}" | grep -Fx "package/README.zh-TW.md"
tar -tzf "${filename}" | grep -Fx "package/LICENSE"
tar -tzf "${filename}" | grep -Fx "package/skill/SKILL.md"
tar -tzf "${filename}" | grep -Fx "package/skill/agents/openai.yaml"
echo "path=${filename}" >> "${GITHUB_OUTPUT}"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
"${{ steps.package.outputs.path }}" \
--repo "${GITHUB_REPOSITORY}" \
--verify-tag \
--title "cpp-debugger-cli ${{ steps.version.outputs.version }}" \
--generate-notes