Repository navigation
558 lines (475 loc) · 19.9 KB
/
Copy pathrelease.yml
File metadata and controls
558 lines (475 loc) · 19.9 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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
name: Release
on:
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g., v1.0.1)"
required: true
type: string
notify_issues:
description: "Comment on open related/fixes issues asking reporters to retest"
required: false
type: boolean
default: false
permissions:
contents: write
actions: write
issues: write
concurrency:
group: release-${{ inputs.tag }}
cancel-in-progress: true
jobs:
verify-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
- name: Verify quickshell/VERSION matches the tag
env:
TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
version=$(cat quickshell/VERSION)
if [ "${version#v}" != "${TAG#v}" ]; then
echo "::error::quickshell/VERSION is '${version}' but the tag is '${TAG}'"; exit 1
fi
build-core:
needs: [verify-version]
runs-on: ubuntu-latest
strategy:
matrix:
include:
- { goos: linux, arch: amd64 }
- { goos: linux, arch: arm64 }
- { goos: freebsd, arch: amd64 }
- { goos: freebsd, arch: arm64 }
defaults:
run:
working-directory: core
env:
TAG: ${{ inputs.tag }}
# linux assets keep their historical arch-only names
ASSET: ${{ matrix.goos == 'linux' && matrix.arch || format('{0}-{1}', matrix.goos, matrix.arch) }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./core/go.mod
- name: Format check
if: matrix.goos == 'linux'
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "The following files are not formatted:"
gofmt -s -l .
exit 1
fi
- name: Run tests
if: matrix.goos == 'linux'
run: go test -v ./...
- name: Build cyshell-install (${{ env.ASSET }})
if: matrix.goos == 'linux'
env:
GOOS: ${{ matrix.goos }}
CGO_ENABLED: 0
GOARCH: ${{ matrix.arch }}
run: |
set -eux
cd cmd/cyshell-install
go build -trimpath -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../cyshell-install-${{ env.ASSET }}
cd ../..
gzip -9 -k cyshell-install-${{ env.ASSET }}
sha256sum cyshell-install-${{ env.ASSET }}.gz > cyshell-install-${{ env.ASSET }}.gz.sha256
- name: Sync embedded shell
run: make sync-shell
- name: Build cyshell (${{ env.ASSET }})
env:
GOOS: ${{ matrix.goos }}
CGO_ENABLED: 0
GOARCH: ${{ matrix.arch }}
run: |
set -eux
cd cmd/cyshell
go build -trimpath -tags withshell -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../cyshell-${{ env.ASSET }}
cd ../..
gzip -9 -k cyshell-${{ env.ASSET }}
sha256sum cyshell-${{ env.ASSET }}.gz > cyshell-${{ env.ASSET }}.gz.sha256
- name: Generate shell completions
if: matrix.goos == 'linux' && matrix.arch == 'amd64'
run: |
set -eux
chmod +x cyshell-amd64
./cyshell-amd64 completion bash > completion.bash
./cyshell-amd64 completion fish > completion.fish
./cyshell-amd64 completion zsh > completion.zsh
- name: Build cyshell-distropkg (${{ env.ASSET }})
env:
GOOS: ${{ matrix.goos }}
CGO_ENABLED: 0
GOARCH: ${{ matrix.arch }}
run: |
set -eux
cd cmd/cyshell
go build -trimpath -tags 'distro_binary withshell' -ldflags "-s -w -X main.Version=${TAG}" \
-o ../../cyshell-distropkg-${{ env.ASSET }}
cd ../..
gzip -9 -k cyshell-distropkg-${{ env.ASSET }}
sha256sum cyshell-distropkg-${{ env.ASSET }}.gz > cyshell-distropkg-${{ env.ASSET }}.gz.sha256
- name: Upload artifacts (${{ env.ASSET }})
if: matrix.goos == 'linux' && matrix.arch == 'arm64'
uses: actions/upload-artifact@v5
with:
name: core-assets-${{ env.ASSET }}
path: |
core/cyshell-install-${{ env.ASSET }}.gz
core/cyshell-install-${{ env.ASSET }}.gz.sha256
core/cyshell-${{ env.ASSET }}.gz
core/cyshell-${{ env.ASSET }}.gz.sha256
core/cyshell-distropkg-${{ env.ASSET }}.gz
core/cyshell-distropkg-${{ env.ASSET }}.gz.sha256
if-no-files-found: error
- name: Upload artifacts (${{ env.ASSET }}, no installer)
if: matrix.goos != 'linux'
uses: actions/upload-artifact@v5
with:
name: core-assets-${{ env.ASSET }}
path: |
core/cyshell-${{ env.ASSET }}.gz
core/cyshell-${{ env.ASSET }}.gz.sha256
core/cyshell-distropkg-${{ env.ASSET }}.gz
core/cyshell-distropkg-${{ env.ASSET }}.gz.sha256
if-no-files-found: error
- name: Upload artifacts with completions
if: matrix.goos == 'linux' && matrix.arch == 'amd64'
uses: actions/upload-artifact@v5
with:
name: core-assets-${{ env.ASSET }}
path: |
core/cyshell-install-${{ env.ASSET }}.gz
core/cyshell-install-${{ env.ASSET }}.gz.sha256
core/cyshell-${{ env.ASSET }}.gz
core/cyshell-${{ env.ASSET }}.gz.sha256
core/cyshell-distropkg-${{ env.ASSET }}.gz
core/cyshell-distropkg-${{ env.ASSET }}.gz.sha256
core/completion.bash
core/completion.fish
core/completion.zsh
if-no-files-found: error
# update-versions:
# runs-on: ubuntu-latest
# needs: build-core
# steps:
# - name: Create GitHub App token
# id: app_token
# uses: actions/create-github-app-token@v1
# with:
# app-id: ${{ secrets.APP_ID }}
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
# - name: Checkout
# uses: actions/checkout@v6
# with:
# token: ${{ steps.app_token.outputs.token }}
# fetch-depth: 0
# - name: Update VERSION
# env:
# GH_TOKEN: ${{ steps.app_token.outputs.token }}
# run: |
# set -euo pipefail
# git config user.name "cyshell-ci[bot]"
# git config user.email "cyshell-ci[bot]@users.noreply.github.com"
# version="${GITHUB_REF#refs/tags/}"
# echo "Updating to version: $version"
# echo "${version}" > quickshell/VERSION
# git add quickshell/VERSION
# if ! git diff --cached --quiet; then
# git commit -m "chore: bump version to $version"
# git pull --rebase origin master
# git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:master
# fi
# git tag -f "${version}"
# git push -f https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git "${version}"
release:
runs-on: ubuntu-24.04
needs: [build-core] #, update-versions]
env:
TAG: ${{ inputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ inputs.tag }}
fetch-depth: 0
submodules: recursive
- name: Fetch updated tag after version bump
run: |
git fetch origin --force tag ${TAG}
git checkout ${TAG}
git submodule update --init --recursive
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ./core/go.mod
- name: Download core artifacts
uses: actions/download-artifact@v5
with:
pattern: core-assets-*
merge-multiple: true
path: ./_core_assets
- name: Generate Changelog
id: changelog
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || echo "")
CHANGELOG=""
if [ -n "$PREVIOUS_TAG" ]; then
# PR-based notes with author credits; falls back to raw git log below
CHANGELOG=$(python3 scripts/release-notes.py "${PREVIOUS_TAG}..${TAG}" --format github --bare 2>/dev/null || true)
fi
if [ -z "$CHANGELOG" ]; then
echo "release-notes.py unavailable or empty, using git log fallback"
if [ -z "$PREVIOUS_TAG" ]; then
CHANGELOG=$(git log --oneline --pretty=format:"%an|%s (%h)" | grep -v "^github-actions\[bot\]|" | sed 's/^[^|]*|/- /' | head -50)
else
CHANGELOG=$(git log --oneline --pretty=format:"%an|%s (%h)" "${PREVIOUS_TAG}..${TAG}" | grep -v "^github-actions\[bot\]|" | sed 's/^[^|]*|/- /')
fi
fi
cat > RELEASE_BODY.md << 'EOF'
## Installation
```bash
curl -fsSL https://install.danklinux.com | sh
```
## Assets
### Complete Packages
- **`cyshell-full-amd64.tar.gz`** - Complete package for x86_64 systems (CLI binaries + QML source + shell completions + installation guide)
- **`cyshell-full-arm64.tar.gz`** - Complete package for ARM64 systems (CLI binaries + QML source + shell completions + installation guide)
- **`cyshell-full-freebsd-amd64.tar.gz`** - Complete package for FreeBSD x86_64 systems
- **`cyshell-full-freebsd-arm64.tar.gz`** - Complete package for FreeBSD ARM64 systems
### Individual Components
- **`cyshell-cli-amd64.gz`** - CyShell CLI binary for x86_64 systems
- **`cyshell-cli-arm64.gz`** - CyShell CLI binary for ARM64 systems
- **`cyshell-cli-freebsd-amd64.gz`** - CyShell CLI binary for FreeBSD x86_64 systems
- **`cyshell-cli-freebsd-arm64.gz`** - CyShell CLI binary for FreeBSD ARM64 systems
- **`cyshell-distropkg-amd64.gz`** - CyShell CLI binary built with distro_package tag for AMD64 systems
- **`cyshell-distropkg-arm64.gz`** - CyShell CLI binary built with distro_package tag for ARM64 systems
- **`cyshell-distropkg-freebsd-amd64.gz`** - CyShell CLI binary built with distro_package tag for FreeBSD x86_64 systems
- **`cyshell-distropkg-freebsd-arm64.gz`** - CyShell CLI binary built with distro_package tag for FreeBSD ARM64 systems
- **`cyshell-install-amd64.gz`** - Installer binary for x86_64 systems
- **`cyshell-install-arm64.gz`** - Installer binary for ARM64 systems
- **`cyshell-cli-<version>.tar.gz`** - Go source code with vendored modules (for distro packaging)
- **`cyshell-qml.tar.gz`** - QML source code only
- **`cyshell-source.tar.gz`** - Full repository source with bundled CyCommon (for distro packaging)
### Checksums
- **`*.sha256`** - SHA256 checksums for verifying download integrity
**Installation:** Extract the `cyshell-full-*.tar.gz` package for your architecture and follow the `INSTALL.md` instructions inside.
---
EOF
cat >> RELEASE_BODY.md << EOF
## What's Changed
$CHANGELOG
**Full Changelog**: https://github.com/${{ github.repository }}/compare/${PREVIOUS_TAG}...${TAG}
EOF
echo "changelog<<EOF" >> $GITHUB_OUTPUT
cat RELEASE_BODY.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Prepare release assets
run: |
set -euxo pipefail
mkdir -p _release_assets
# Copy core binaries and rename cyshell-*.gz to cyshell-cli-*.gz
for file in _core_assets/cyshell-*.gz*; do
if [ -f "$file" ]; then
basename=$(basename "$file")
if [[ "$basename" == cyshell-distropkg-* ]]; then
cp "$file" "_release_assets/$basename"
else
newname=$(echo "$basename" | sed 's/^cyshell-/cyshell-cli-/')
cp "$file" "_release_assets/$newname"
fi
fi
done
# Copy cyshell-install binaries
cp _core_assets/cyshell-install-*.gz* _release_assets/
# Copy completions
cp _core_assets/completion.* _release_assets/ 2>/dev/null || true
# Replace the CyCommon symlink with real submodule content for packaging
rm quickshell/CyCommon
cp -r dank-qml-common/CyCommon quickshell/CyCommon
# Create full source tarball (GitHub tag archives never contain submodule content)
VERSION_NUM=${TAG#v}
tar --exclude='.git' \
--exclude='.github' \
--exclude='dank-qml-common' \
--exclude='_release_assets' \
--exclude='_core_assets' \
--exclude='RELEASE_BODY.md' \
--transform "s,^\.,CyShell-Desktop-${VERSION_NUM},S" \
-czf _release_assets/cyshell-source.tar.gz .
(cd _release_assets && sha256sum cyshell-source.tar.gz > cyshell-source.tar.gz.sha256)
# Create QML source package (exclude build artifacts and git files)
# Copy root LICENSE and CONTRIBUTING.md to quickshell/ for packaging
cp LICENSE CONTRIBUTING.md quickshell/
# Copy root assets directory to quickshell for systemd service and desktop file
cp -r assets quickshell/
# Tar the CONTENTS of quickshell/, not the directory itself
(cd quickshell && tar --exclude='.git' \
--exclude='.github' \
--exclude='./tests' \
--exclude='*.tar.gz' \
--exclude-from=../scripts/shell-test-excludes.txt \
-czf ../_release_assets/cyshell-qml.tar.gz .)
# Generate checksum for QML package
(cd _release_assets && sha256sum cyshell-qml.tar.gz > cyshell-qml.tar.gz.sha256)
# Create full packages for each os/architecture
for arch in amd64 arm64 freebsd-amd64 freebsd-arm64; do
mkdir -p _temp_full/cyshell
mkdir -p _temp_full/bin
mkdir -p _temp_full/completions
# Extract QML source
tar -xzf _release_assets/cyshell-qml.tar.gz -C _temp_full/cyshell
# Add CLI binaries
if [ -f "_core_assets/cyshell-${arch}.gz" ]; then
gunzip -c "_core_assets/cyshell-${arch}.gz" > _temp_full/bin/cyshell
chmod +x _temp_full/bin/cyshell
fi
if [ -f "_core_assets/cyshell-distropkg-${arch}.gz" ]; then
gunzip -c "_core_assets/cyshell-distropkg-${arch}.gz" > _temp_full/bin/cyshell-distropkg
chmod +x _temp_full/bin/cyshell-distropkg
fi
# Add shell completions
for completion in _core_assets/completion.*; do
if [ -f "$completion" ]; then
cp "$completion" _temp_full/completions/
fi
done
# Copy docs directory
if [ -d "docs" ]; then
cp -r docs _temp_full/
fi
# Create installation guide
cat > _temp_full/INSTALL.md << 'EOFINSTALL'
# CyShell Installation
## Requirements
- Wayland compositor (niri or Hyprland recommended)
- Quickshell framework
- Qt6
## Installation Steps
The Quickshell UI is embedded in the `cyshell` binary. The bundled `cyshell/`
tree is optional — pass it with `-c` or `CYSHELL_SHELL_DIR` to run a
modified copy instead of the embedded UI.
1. **Install the CyShell CLI binaries:**
```bash
sudo install -m 755 bin/cyshell /usr/local/bin/cyshell
```
2. **Install shell completions (optional):**
```bash
# Bash
sudo install -m 644 completions/completion.bash /usr/share/bash-completion/completions/cyshell
# Fish
sudo install -m 644 completions/completion.fish /usr/share/fish/vendor_completions.d/cyshell.fish
# Zsh
sudo install -m 644 completions/completion.zsh /usr/share/zsh/site-functions/_cyshell
```
3. **Start the shell:**
```bash
cyshell run
```
## Configuration
- Settings are stored in `~/.config/CyShell/settings.json`
- Plugins go in `~/.config/CyShell/plugins/`
- See the documentation in the `cyshell/` directory for more details
## Troubleshooting
- Run with verbose output: `CYSHELL_LOG_LEVEL=debug cyshell run`
- Ensure all dependencies are installed
EOFINSTALL
# Create the full package
(cd _temp_full && tar -czf "../_release_assets/cyshell-full-${arch}.tar.gz" .)
# Generate checksum
(cd _release_assets && sha256sum "cyshell-full-${arch}.tar.gz" > "cyshell-full-${arch}.tar.gz.sha256")
# Cleanup
rm -rf _temp_full
done
- name: Generate vendored source tarball
run: |
set -euxo pipefail
VERSION_NUM=${TAG#v}
cd core
go mod vendor
cd ..
tar czf "_release_assets/cyshell-cli-${VERSION_NUM}.tar.gz" \
--transform "s,^core/,cyshell-cli-${VERSION_NUM}/," \
--exclude='core/.git' \
core/
(cd _release_assets && sha256sum "cyshell-cli-${VERSION_NUM}.tar.gz" > "cyshell-cli-${VERSION_NUM}.tar.gz.sha256")
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG }}
name: Release ${{ env.TAG }}
body: ${{ steps.changelog.outputs.changelog }}
files: _release_assets/**
draft: false
prerelease: ${{ contains(env.TAG, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Ask reporters on still-open "related/fixes #N" issues to retest.
# Opt-in via notify_issues (Point release defaults it on). Skipped for
# prereleases. Preview: scripts/notify-issues.sh <prev> <tag> --dry-run
- name: Notify open issues to retest
if: ${{ inputs.notify_issues && !contains(env.TAG, '-') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
PREVIOUS_TAG=$(git describe --tags --abbrev=0 "${TAG}^" 2>/dev/null || true)
if [ -z "$PREVIOUS_TAG" ]; then
echo "no previous tag; skipping issue notify"
exit 0
fi
bash scripts/notify-issues.sh "$PREVIOUS_TAG" "$TAG"
# Pin the satellite repos to this release's version. Each dispatch target
# decides for itself whether to tag: X.Y.0 always tags, X.Y.Z skips when the
# repo has no commits of its own since its last tag.
fanout:
name: Pin ${{ matrix.repo }}
runs-on: ubuntu-latest
needs: [release]
if: ${{ !contains(inputs.tag, '-') }}
strategy:
fail-fast: false
matrix:
repo:
- dgop
- dankgo
- CyShell-QML-Common
- dankcalendar
- danksearch
- dank-greeter
steps:
- name: Create GitHub App token
id: app_token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: ${{ matrix.repo }}
- name: Dispatch pin-release
env:
GH_TOKEN: ${{ steps.app_token.outputs.token }}
REPO: ${{ github.repository_owner }}/${{ matrix.repo }}
TAG: ${{ inputs.tag }}
run: |
set -euo pipefail
gh workflow run pin-release.yml --repo "$REPO" -f version="$TAG"
echo "dispatched pin-release ${TAG} to ${REPO}" >> "$GITHUB_STEP_SUMMARY"