-
Notifications
You must be signed in to change notification settings - Fork 228
137 lines (114 loc) · 3.3 KB
/
release.yml
File metadata and controls
137 lines (114 loc) · 3.3 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g. v0.0.2)"
required: true
type: string
permissions:
contents: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m
build-unix:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-24.04-arm
goos: linux
goarch: arm64
- os: macos-14
goos: darwin
goarch: arm64
- os: macos-15-intel
goos: darwin
goarch: amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Run tests
run: go test ./...
- name: Build binary
run: |
CGO_ENABLED=1 go build \
-ldflags "-X main.version=${{ inputs.version }}" \
-o codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }} \
./cmd/codebase-memory-mcp/
- name: Create archive
run: tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}
- uses: actions/upload-artifact@v4
with:
name: codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}
path: "*.tar.gz"
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
path-type: inherit
install: mingw-w64-ucrt-x86_64-gcc
- name: Run tests
shell: msys2 {0}
run: |
which go
go version
go test ./...
- name: Build binary
shell: msys2 {0}
run: |
CGO_ENABLED=1 CC=gcc go build \
-ldflags "-X main.version=${{ inputs.version }}" \
-o codebase-memory-mcp-windows-amd64.exe \
./cmd/codebase-memory-mcp/
- name: Create archive
shell: pwsh
run: Compress-Archive -Path codebase-memory-mcp-windows-amd64.exe -DestinationPath codebase-memory-mcp-windows-amd64.zip
- uses: actions/upload-artifact@v4
with:
name: codebase-memory-mcp-windows-amd64
path: "*.zip"
release:
needs: [lint, build-unix, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Generate checksums
run: sha256sum *.tar.gz *.zip > checksums.txt
- name: Create tag
run: |
git tag ${{ inputs.version }}
git push origin ${{ inputs.version }}
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.version }}
files: |
*.tar.gz
*.zip
checksums.txt
generate_release_notes: true