-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (113 loc) · 4.24 KB
/
release.yml
File metadata and controls
139 lines (113 loc) · 4.24 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
138
139
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write # needed to create GitHub Releases and upload assets
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
asset_name: opsagent-linux-x86_64
- os: macos-14 # Apple Silicon
asset_name: opsagent-macos-arm64
- os: windows-latest
asset_name: opsagent-windows-x86_64.exe
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: pip install -e ".[all-providers,build]"
- name: Build executable
run: pyinstaller opsagent.spec
- name: Rename executable (Unix)
if: runner.os != 'Windows'
run: mv dist/opsagent dist/${{ matrix.asset_name }}
- name: Rename executable (Windows)
if: runner.os == 'Windows'
run: mv dist/opsagent.exe dist/${{ matrix.asset_name }}
- name: Smoke test — help (Unix)
if: runner.os != 'Windows'
run: dist/${{ matrix.asset_name }} --help
- name: Smoke test — help (Windows)
if: runner.os == 'Windows'
run: dist/${{ matrix.asset_name }} --help
- name: Smoke test — MCP server startup (Unix)
if: runner.os != 'Windows'
run: |
for server in workspace git notification; do
echo '{}' | timeout 5 dist/${{ matrix.asset_name }} --serve $server || true
echo "MCP server $server: OK"
done
- name: Smoke test — MCP server startup (Windows)
if: runner.os == 'Windows'
run: |
foreach ($server in @("workspace", "git", "notification")) {
$job = Start-Job { param($bin, $srv) echo '{}' | & $bin --serve $srv } -ArgumentList "dist\${{ matrix.asset_name }}", $server
Start-Sleep 3
Stop-Job $job
Write-Host "MCP server $server`: OK"
}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}
release:
name: Publish GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: OpsAgent ${{ github.ref_name }}
body: |
## OpsAgent ${{ github.ref_name }}
AI-powered CI/CD failure first responder — single executable, no Python required.
### Download
| Platform | File |
|---|---|
| Linux x86_64 | `opsagent-linux-x86_64` |
| macOS Apple Silicon | `opsagent-macos-arm64` |
| Windows x86_64 | `opsagent-windows-x86_64.exe` |
### Quick start
```bash
# Linux / macOS
curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/opsagent-linux-x86_64 \
-o opsagent && chmod +x opsagent
./opsagent --log-path build.log --workspace .
```
### GitHub Actions
```yaml
- name: Run OpsAgent RCA
if: failure()
run: |
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/opsagent-linux-x86_64 \
-o /usr/local/bin/opsagent
chmod +x /usr/local/bin/opsagent
opsagent --log-path "${{ runner.temp }}/build.log" \
--workspace "${{ github.workspace }}"
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
```
files: |
dist/opsagent-linux-x86_64/opsagent-linux-x86_64
dist/opsagent-macos-arm64/opsagent-macos-arm64
dist/opsagent-windows-x86_64.exe/opsagent-windows-x86_64.exe
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}