-
Notifications
You must be signed in to change notification settings - Fork 1
271 lines (236 loc) · 7.26 KB
/
release.yml
File metadata and controls
271 lines (236 loc) · 7.26 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
python-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
cd implementations/python
pip install -e .
- name: Build package
run: |
cd implementations/python
python -m build
- name: Check package
run: |
cd implementations/python
twine check dist/*
- name: Generate release notes
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "# Release Notes for v$VERSION" > RELEASE_NOTES.md
echo "" >> RELEASE_NOTES.md
echo "## Changes" >> RELEASE_NOTES.md
LAST_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
git log --pretty=format:"- %s" $LAST_TAG..HEAD >> RELEASE_NOTES.md
else
git log --pretty=format:"- %s" >> RELEASE_NOTES.md
fi
- name: Upload Python dist
uses: actions/upload-artifact@v7
with:
name: python-dist
path: implementations/python/dist/
- name: Upload release notes
uses: actions/upload-artifact@v7
with:
name: release-notes
path: RELEASE_NOTES.md
# Uncomment when ready to publish to PyPI
# - name: Publish to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: |
# cd implementations/python
# twine upload dist/*
vscode-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Install dependencies
run: |
cd vscode-extension
npm ci
- name: Compile TypeScript
run: |
cd vscode-extension
npm run compile
- name: Package extension (VSIX)
run: |
cd vscode-extension
npx @vscode/vsce package --no-dependencies -o cfgpp-language-support.vsix
- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -z "$VSCE_PAT" ]; then
echo "VSCE_PAT secret not set — skipping VS Code Marketplace publish."
echo "Add it at Settings → Secrets and variables → Actions to enable."
exit 0
fi
cd vscode-extension
npx @vscode/vsce publish --no-dependencies --packagePath cfgpp-language-support.vsix
- name: Publish to Open VSX Registry
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
if [ -z "$OVSX_PAT" ]; then
echo "OVSX_PAT secret not set — skipping Open VSX publish."
echo "Add it at Settings → Secrets and variables → Actions to enable."
exit 0
fi
cd vscode-extension
npx ovsx publish cfgpp-language-support.vsix -p "$OVSX_PAT"
- name: Upload VSIX
uses: actions/upload-artifact@v7
with:
name: vscode-extension
path: vscode-extension/cfgpp-language-support.vsix
installers:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact_name: cfgpp-linux-x64
- os: windows-latest
artifact_name: cfgpp-windows-x64
- os: macos-latest
artifact_name: cfgpp-macos-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
cd implementations/python
pip install -e .
- name: Build executable with PyInstaller
shell: bash
run: |
cd implementations/python
pyinstaller --onefile --name cfgpp --console src/cfgpp_standalone.py
- name: Smoke-test executable
shell: bash
run: |
cd implementations/python/dist
if [ "${{ matrix.os }}" == "windows-latest" ]; then
./cfgpp.exe --help
else
./cfgpp --help
fi
- name: Assemble installer package
shell: bash
run: |
cd implementations/python
mkdir -p installer
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cp dist/cfgpp.exe installer/
else
cp dist/cfgpp installer/
fi
cp README.md installer/
cp ../../LICENSE installer/ || echo "No LICENSE file found"
if [ "${{ matrix.os }}" != "windows-latest" ]; then
cat > installer/install.sh << 'EOF'
#!/bin/bash
INSTALL_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR"
cp cfgpp "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR/cfgpp"
echo "CFGPP installed to $INSTALL_DIR/cfgpp"
echo "Add $INSTALL_DIR to your PATH if not already present."
EOF
chmod +x installer/install.sh
else
cat > installer/install.bat << 'EOF'
@echo off
set "INSTALL_DIR=%LOCALAPPDATA%\cfgpp"
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
copy cfgpp.exe "%INSTALL_DIR%\"
echo CFGPP installed to %INSTALL_DIR%\cfgpp.exe
echo Add %INSTALL_DIR% to your PATH environment variable.
pause
EOF
fi
- name: Create archive
shell: bash
run: |
cd implementations/python/installer
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7z a ../${{ matrix.artifact_name }}.zip *
else
tar -czf ../${{ matrix.artifact_name }}.tar.gz *
fi
- name: Upload installer artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact_name }}
path: |
implementations/python/${{ matrix.artifact_name }}.zip
implementations/python/${{ matrix.artifact_name }}.tar.gz
release:
runs-on: ubuntu-latest
needs: [python-build, vscode-extension, installers]
steps:
- name: Download Python dist
uses: actions/download-artifact@v8
with:
name: python-dist
path: release-assets/
- name: Download VSIX
uses: actions/download-artifact@v8
with:
name: vscode-extension
path: release-assets/
- name: Download Linux installer
uses: actions/download-artifact@v8
with:
name: cfgpp-linux-x64
path: release-assets/
- name: Download Windows installer
uses: actions/download-artifact@v8
with:
name: cfgpp-windows-x64
path: release-assets/
- name: Download macOS installer
uses: actions/download-artifact@v8
with:
name: cfgpp-macos-x64
path: release-assets/
- name: Download release notes
uses: actions/download-artifact@v8
with:
name: release-notes
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
body_path: RELEASE_NOTES.md
files: release-assets/*