Repository navigation
723 lines (618 loc) · 26.5 KB
/
Copy pathrelease.yml
File metadata and controls
723 lines (618 loc) · 26.5 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
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
# Least privilege by default; jobs that need more (e.g. creating the GitHub
# release) raise it explicitly at the job level.
permissions:
contents: read
jobs:
build-deb:
name: Build Debian Package
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libvte-2.91-gtk4-dev \
libadwaita-1-dev \
libdbus-1-dev \
libssl-dev \
libasound2-dev \
pkg-config \
debhelper \
devscripts \
gettext
- name: Build release binary
run: cargo build --release -p rustconn -p rustconn-cli
- name: Create deb package structure
run: |
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
PKG_DIR="rustconn_${VERSION}_amd64"
mkdir -p "${PKG_DIR}/DEBIAN"
mkdir -p "${PKG_DIR}/usr/bin"
mkdir -p "${PKG_DIR}/usr/share/applications"
mkdir -p "${PKG_DIR}/usr/share/metainfo"
mkdir -p "${PKG_DIR}/usr/share/icons/hicolor/scalable/apps"
mkdir -p "${PKG_DIR}/usr/share/icons/hicolor/256x256/apps"
mkdir -p "${PKG_DIR}/usr/share/icons/hicolor/128x128/apps"
mkdir -p "${PKG_DIR}/usr/share/doc/rustconn"
# Binaries
cp target/release/rustconn "${PKG_DIR}/usr/bin/"
cp target/release/rustconn-cli "${PKG_DIR}/usr/bin/"
# Desktop file and metadata
cp rustconn/assets/io.github.totoshko88.RustConn.desktop "${PKG_DIR}/usr/share/applications/"
cp rustconn/assets/io.github.totoshko88.RustConn.metainfo.xml "${PKG_DIR}/usr/share/metainfo/"
# Icons
cp rustconn/assets/icons/hicolor/scalable/apps/io.github.totoshko88.RustConn.svg \
"${PKG_DIR}/usr/share/icons/hicolor/scalable/apps/" || true
for size in 256 128; do
cp "rustconn/assets/icons/hicolor/${size}x${size}/apps/io.github.totoshko88.RustConn.png" \
"${PKG_DIR}/usr/share/icons/hicolor/${size}x${size}/apps/" 2>/dev/null || true
done
# Docs and copyright
cp README.md LICENSE CHANGELOG.md "${PKG_DIR}/usr/share/doc/rustconn/"
cp debian/copyright "${PKG_DIR}/usr/share/doc/rustconn/copyright"
# Locale files (compile .po to .mo)
for po_file in po/*.po; do
[ -f "$po_file" ] || continue
lang=$(basename "$po_file" .po)
mkdir -p "${PKG_DIR}/usr/share/locale/${lang}/LC_MESSAGES"
msgfmt -o "${PKG_DIR}/usr/share/locale/${lang}/LC_MESSAGES/rustconn.mo" "$po_file"
done
# Control file
cat > "${PKG_DIR}/DEBIAN/control" << EOF
Package: rustconn
Version: ${VERSION}
Section: net
Priority: optional
Architecture: amd64
Depends: libgtk-4-1 (>= 4.14), libvte-2.91-gtk4-0, libadwaita-1-0, openssh-client
Recommends: freerdp2-x11, tigervnc-viewer, virt-viewer
Maintainer: Anton Isaiev <totoshko88@gmail.com>
Homepage: https://github.com/totoshko88/RustConn
Description: Modern connection manager for Linux
RustConn is a GTK4-based connection manager for SSH, RDP, VNC, and SPICE
remote connections with support for embedded terminals, connection groups,
import/export, and secure credential storage.
EOF
# Build deb
dpkg-deb --build "${PKG_DIR}"
mkdir -p dist
mv "${PKG_DIR}.deb" dist/
- name: Upload deb artifact
uses: actions/upload-artifact@v6
with:
name: debian-package
path: dist/*.deb
build-rpm:
name: Build RPM Package
runs-on: ubuntu-24.04
container:
image: fedora:44
steps:
- name: Install build tools
run: |
dnf install -y \
git \
curl \
gcc \
make \
pkg-config \
gtk4-devel \
vte291-gtk4-devel \
libadwaita-devel \
dbus-devel \
openssl-devel \
alsa-lib-devel \
rpm-build \
ruby-devel \
rubygems \
zstd \
gettext
- name: Install fpm
run: gem install fpm
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.95.0 --profile minimal
source $HOME/.cargo/env
rustc --version
cargo --version
- name: Build release binary
run: |
source $HOME/.cargo/env
cargo build --release -p rustconn -p rustconn-cli
- name: Create RPM package
run: |
source $HOME/.cargo/env
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
# Create staging directory
mkdir -p staging/usr/bin
mkdir -p staging/usr/share/applications
mkdir -p staging/usr/share/metainfo
mkdir -p staging/usr/share/icons/hicolor/scalable/apps
mkdir -p staging/usr/share/icons/hicolor/128x128/apps
mkdir -p staging/usr/share/icons/hicolor/256x256/apps
# Copy binaries
cp target/release/rustconn staging/usr/bin/
cp target/release/rustconn-cli staging/usr/bin/
# Copy desktop file and metadata
cp rustconn/assets/io.github.totoshko88.RustConn.desktop staging/usr/share/applications/
cp rustconn/assets/io.github.totoshko88.RustConn.metainfo.xml staging/usr/share/metainfo/
# Copy icons
cp rustconn/assets/icons/hicolor/scalable/apps/io.github.totoshko88.RustConn.svg \
staging/usr/share/icons/hicolor/scalable/apps/ 2>/dev/null || true
for size in 128 256; do
cp "rustconn/assets/icons/hicolor/${size}x${size}/apps/io.github.totoshko88.RustConn.png" \
"staging/usr/share/icons/hicolor/${size}x${size}/apps/" 2>/dev/null || true
done
# Locale files (compile .po to .mo)
for po_file in po/*.po; do
[ -f "$po_file" ] || continue
lang=$(basename "$po_file" .po)
mkdir -p "staging/usr/share/locale/${lang}/LC_MESSAGES"
msgfmt -o "staging/usr/share/locale/${lang}/LC_MESSAGES/rustconn.mo" "$po_file"
done
# Build RPM with fpm
fpm -s dir -t rpm \
-n rustconn \
-v "${VERSION}" \
--iteration 1 \
--license "GPL-3.0-or-later" \
--vendor "Anton Isaiev" \
--maintainer "Anton Isaiev <totoshko88@gmail.com>" \
--url "https://github.com/totoshko88/RustConn" \
--description "Modern connection manager for Linux (SSH, RDP, VNC, SPICE)" \
--depends "gtk4 >= 4.14" \
--depends "libadwaita" \
--depends "vte291-gtk4" \
--depends "openssh-clients" \
-C staging \
usr
# Move to dist
mkdir -p dist
mv *.rpm dist/
echo "=== Built RPM packages ==="
ls -la dist/
- name: Upload RPM artifact
uses: actions/upload-artifact@v6
with:
name: rpm-package
path: dist/*.rpm
build-appimage:
name: Build AppImage
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-4-dev \
libvte-2.91-gtk4-dev \
libadwaita-1-dev \
libdbus-1-dev \
libssl-dev \
libasound2-dev \
pkg-config \
libfuse2 \
gettext
- name: Build release
run: cargo build --release -p rustconn -p rustconn-cli
- name: Download linuxdeploy
run: |
# linuxdeploy ships only a "continuous" tag whose artifacts are
# rebuilt (checksums are not stable) — retry + ELF sanity check.
# The GTK plugin is a plain script: pin commit + checksum.
wget -q --tries=5 --waitretry=10 https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
file linuxdeploy-x86_64.AppImage | grep -q 'ELF 64-bit' || { echo "::error::linuxdeploy download is not an ELF binary"; exit 1; }
GTK_PLUGIN_COMMIT=3b67a1d1c1b0c8268f57f2bce40fe2d33d409cea
GTK_PLUGIN_SHA256=b0f4cbc684a0103a9651f0955b635eaea0096b3a66c0f5a2c2aa337960375171
wget -q "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/${GTK_PLUGIN_COMMIT}/linuxdeploy-plugin-gtk.sh"
echo "${GTK_PLUGIN_SHA256} linuxdeploy-plugin-gtk.sh" | sha256sum -c -
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-gtk.sh
- name: Prepare AppDir
run: |
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
mkdir -p AppDir/usr/share/icons/hicolor/128x128/apps
mkdir -p AppDir/usr/share/metainfo
cp target/release/rustconn AppDir/usr/bin/
cp target/release/rustconn-cli AppDir/usr/bin/
cp rustconn/assets/io.github.totoshko88.RustConn.desktop AppDir/usr/share/applications/
cp rustconn/assets/io.github.totoshko88.RustConn.metainfo.xml AppDir/usr/share/metainfo/
# Copy icons
cp rustconn/assets/icons/hicolor/scalable/apps/io.github.totoshko88.RustConn.svg \
AppDir/usr/share/icons/hicolor/scalable/apps/ || true
for size in 256 128; do
cp "rustconn/assets/icons/hicolor/${size}x${size}/apps/io.github.totoshko88.RustConn.png" \
"AppDir/usr/share/icons/hicolor/${size}x${size}/apps/" 2>/dev/null || true
done
# Locale files (compile .po to .mo)
for po_file in po/*.po; do
[ -f "$po_file" ] || continue
lang=$(basename "$po_file" .po)
mkdir -p "AppDir/usr/share/locale/${lang}/LC_MESSAGES"
msgfmt -o "AppDir/usr/share/locale/${lang}/LC_MESSAGES/rustconn.mo" "$po_file"
done
- name: Build AppImage
run: |
DEPLOY_GTK_VERSION=4 ./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--plugin gtk \
--output appimage
# Rename to include version
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
mv RustConn*.AppImage "RustConn-${VERSION}-x86_64.AppImage"
- name: Upload AppImage artifact
uses: actions/upload-artifact@v6
with:
name: appimage
path: "*.AppImage"
build-snap:
name: Build & Publish Snap Package
# Post-release job (like update-obs / update-homebrew): snapcraft + LXD are
# slow and occasionally flaky, so we must NOT gate the GitHub release on it.
# The release is created first; the snap is then built, published to the
# store, and attached to the existing release. A snap failure no longer
# blocks the release.
needs: [release]
if: startsWith(github.ref, 'refs/tags/')
strategy:
fail-fast: false
matrix:
include:
- { runner: ubuntu-24.04, arch: amd64 }
- { runner: ubuntu-24.04-arm, arch: arm64 }
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup LXD
uses: canonical/setup-lxd@8c6a87bfb56aa48f3fb9b830baa18562d8bfd4ee # v1
- name: Install Snapcraft
run: |
# core24 + the `gnome` extension are fully supported by stable Snapcraft.
# (Moved off core26: the gnome extension required for GTK4 does not
# support core26 yet — see snapcraft#6185 and RustConn#174.)
sudo snap install snapcraft --classic
snapcraft --version
- name: Build Snap
id: build
run: |
snapcraft pack --verbose
SNAP_FILE=$(ls *.snap)
echo "snap=$SNAP_FILE" >> $GITHUB_OUTPUT
echo "Built: $SNAP_FILE"
- name: Upload Snap artifact
uses: actions/upload-artifact@v6
with:
name: snap-package-${{ matrix.arch }}
path: ${{ steps.build.outputs.snap }}
- name: Publish to Snap Store
if: startsWith(github.ref, 'refs/tags/v')
continue-on-error: true
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_TOKEN }}
# Channel layout since snapcraft.io Builds (Launchpad) was enabled:
# edge — rolling builds from main, auto-published by the
# snapcraft.io build service (do NOT upload here: two
# publishers racing for edge produce confusing history)
# candidate — tagged release builds from this workflow (exact
# released code, CI provenance)
# stable — manual promote of a tested candidate revision;
# "Update metadata on release" then syncs the store
# listing from that revision's snapcraft.yaml
timeout-minutes: 10
run: snapcraft upload ${{ steps.build.outputs.snap }} --release candidate
- name: Attach snap to the GitHub release
# Best-effort: the release already exists (this job needs it). A failure
# here does not affect the store publish above or the release itself.
continue-on-error: true
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
files: ${{ steps.build.outputs.snap }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-flatpak:
name: Build Flatpak
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install flatpak-cargo-generator
run: |
pip install aiohttp toml tomlkit
- name: Generate cargo sources
run: |
# Pinned commit + checksum: this script shapes which sources end
# up in the Flatpak build (supply-chain hygiene)
FBT_COMMIT=737c0085912f9f7dabf9341d4608e2a77a51a73a
FBT_SHA256=b373c8ab1a05378ec5d8ed0645c7b127bcec7d2f7a1798694fbc627d570d856c
wget -q "https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/${FBT_COMMIT}/cargo/flatpak-cargo-generator.py"
echo "${FBT_SHA256} flatpak-cargo-generator.py" | sha256sum -c -
chmod +x flatpak-cargo-generator.py
python3 flatpak-cargo-generator.py Cargo.lock -o packaging/flatpak/cargo-sources.json
cp packaging/flatpak/cargo-sources.json packaging/flathub/cargo-sources.json
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
manifest-path: packaging/flatpak/io.github.totoshko88.RustConn.yml
bundle: RustConn.flatpak
cache-key: flatpak-builder-${{ github.sha }}
build-bundle: true
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v6
with:
name: flatpak
path: RustConn.flatpak
release:
name: Create Release
needs: [build-deb, build-rpm, build-appimage, build-flatpak]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download deb artifact
uses: actions/download-artifact@v7
with:
name: debian-package
path: dist/
- name: Download RPM artifact
uses: actions/download-artifact@v7
with:
name: rpm-package
path: dist/
- name: Download AppImage artifact
uses: actions/download-artifact@v7
with:
name: appimage
path: dist/
- name: Download Flatpak artifact
uses: actions/download-artifact@v7
with:
name: flatpak
path: dist/
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Rename Flatpak with version
run: mv dist/RustConn.flatpak "dist/RustConn-${{ steps.version.outputs.VERSION }}.flatpak"
- name: Extract changelog for version
id: changelog
run: |
VERSION=${{ steps.version.outputs.VERSION }}
# Extract changelog section for this version
# Start capturing after finding ## [VERSION], stop at next ## [
awk -v ver="${VERSION}" '
BEGIN { found=0 }
/^## \[/ {
if (found) exit
if (index($0, "[" ver "]") > 0) { found=1; next }
}
found && !/^$/ { print }
found && /^$/ { print }
' CHANGELOG.md > version_changelog.md
# Debug: show what was extracted
echo "=== Extracted changelog for ${VERSION} ==="
cat version_changelog.md
echo "=== End changelog ==="
# If no changelog found, use default message
if [ ! -s version_changelog.md ]; then
echo "Release ${VERSION}" > version_changelog.md
fi
- name: Generate release notes
id: notes
run: |
VERSION=${{ steps.version.outputs.VERSION }}
cat << 'HEADER' > release_notes.md
## What's Changed
HEADER
cat version_changelog.md >> release_notes.md
cat << EOF >> release_notes.md
## Installation
### Flatpak (Recommended)
\`\`\`bash
flatpak install flathub io.github.totoshko88.RustConn
\`\`\`
### Snap
\`\`\`bash
sudo snap install rustconn
\`\`\`
### Debian/Ubuntu (.deb from this release)
\`\`\`bash
sudo dpkg -i rustconn_${VERSION}_amd64.deb
sudo apt-get install -f # Install dependencies if needed
\`\`\`
### Fedora (.rpm from this release)
\`\`\`bash
sudo dnf install rustconn-${VERSION}-1.fc44.x86_64.rpm
\`\`\`
### AppImage
\`\`\`bash
chmod +x RustConn-${VERSION}-x86_64.AppImage
./RustConn-${VERSION}-x86_64.AppImage
\`\`\`
### macOS (Homebrew)
\`\`\`bash
brew tap totoshko88/rustconn
brew install rustconn
open \$(brew --prefix)/opt/rustconn/RustConn.app
\`\`\`
All dependencies (GTK4, libadwaita, VTE, Adwaita icons) are installed automatically.
Requires macOS 13 (Ventura) or later.
### OBS Repositories
Packages available at: https://build.opensuse.org/package/show/home:totoshko88:rustconn/rustconn
\`\`\`bash
# Debian 13 (Trixie)
echo 'deb http://download.opensuse.org/repositories/home:/totoshko88:/rustconn/Debian_13/ /' \\
| sudo tee /etc/apt/sources.list.d/rustconn.list
curl -fsSL https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/Debian_13/Release.key \\
| gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/rustconn.gpg > /dev/null
sudo apt update && sudo apt install rustconn
# Ubuntu 24.04 LTS (Noble)
echo 'deb http://download.opensuse.org/repositories/home:/totoshko88:/rustconn/xUbuntu_24.04/ /' \\
| sudo tee /etc/apt/sources.list.d/rustconn.list
curl -fsSL https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/xUbuntu_24.04/Release.key \\
| gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/rustconn.gpg > /dev/null
sudo apt update && sudo apt install rustconn
# Ubuntu 26.04 LTS (Resolute)
echo 'deb http://download.opensuse.org/repositories/home:/totoshko88:/rustconn/xUbuntu_26.04/ /' \\
| sudo tee /etc/apt/sources.list.d/rustconn.list
curl -fsSL https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/xUbuntu_26.04/Release.key \\
| gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/rustconn.gpg > /dev/null
sudo apt update && sudo apt install rustconn
# Fedora 44
sudo dnf config-manager addrepo --from-repofile=https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/Fedora_44/home:totoshko88:rustconn.repo
sudo dnf install rustconn
# Fedora 43
sudo dnf config-manager addrepo --from-repofile=https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/Fedora_43/home:totoshko88:rustconn.repo
sudo dnf install rustconn
# openSUSE Tumbleweed
sudo zypper ar https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/openSUSE_Tumbleweed/ rustconn
sudo zypper ref && sudo zypper in rustconn
# openSUSE Leap 16.0
sudo zypper ar https://download.opensuse.org/repositories/home:/totoshko88:/rustconn/openSUSE_Leap_16.0/ rustconn
sudo zypper ref && sudo zypper in rustconn
\`\`\`
### Arch Linux (AUR)
\`\`\`bash
yay -S rustconn
\`\`\`
### FreeBSD (Ports)
\`\`\`bash
pkg install rustconn
\`\`\`
Full installation guide: https://github.com/totoshko88/RustConn/blob/main/docs/INSTALL.md
EOF
- name: List artifacts
run: ls -la dist/
- name: Create Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
files: dist/*
body_path: release_notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-obs:
name: Update OBS Package
needs: [release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y zstd osc
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Publish to OBS
env:
OBS_USERNAME: ${{ secrets.OBS_USERNAME }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
run: ./scripts/obs-publish.sh "${{ steps.version.outputs.VERSION }}"
update-homebrew:
name: Update Homebrew Tap
needs: [release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout RustConn
uses: actions/checkout@v6
- name: Get version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Download source tarball and compute SHA256
id: sha
run: |
VERSION=${{ steps.version.outputs.VERSION }}
URL="https://github.com/totoshko88/RustConn/archive/refs/tags/v${VERSION}.tar.gz"
# Retry: the tag tarball may not be replicated to all CDN nodes
# in the first seconds after the release is created
curl --retry 5 --retry-delay 10 --retry-all-errors -sL "$URL" -o source.tar.gz
tar -tzf source.tar.gz > /dev/null || { echo "::error::Downloaded tarball is corrupt"; exit 1; }
SHA256=$(sha256sum source.tar.gz | cut -d' ' -f1)
echo "SHA256=${SHA256}" >> $GITHUB_OUTPUT
echo "Source tarball SHA256: ${SHA256}"
- name: Checkout Homebrew tap
uses: actions/checkout@v6
with:
repository: totoshko88/homebrew-rustconn
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tap
- name: Update formula
run: |
VERSION=${{ steps.version.outputs.VERSION }}
SHA256=${{ steps.sha.outputs.SHA256 }}
FORMULA="homebrew-tap/Formula/rustconn.rb"
# Update version in url
sed -i "s|url \"https://github.com/totoshko88/RustConn/archive/refs/tags/v[^\"]*\.tar\.gz\"|url \"https://github.com/totoshko88/RustConn/archive/refs/tags/v${VERSION}.tar.gz\"|" "$FORMULA"
# Update or insert sha256
if grep -q '# sha256' "$FORMULA"; then
# Replace commented-out sha256 with real one
sed -i "s|# sha256 \".*\"|sha256 \"${SHA256}\"|" "$FORMULA"
elif grep -q 'sha256 "' "$FORMULA"; then
# Update existing sha256
sed -i "s|sha256 \"[^\"]*\"|sha256 \"${SHA256}\"|" "$FORMULA"
else
# Insert sha256 after url line
sed -i "/^ url /a\\ sha256 \"${SHA256}\"" "$FORMULA"
fi
echo "=== Updated formula ==="
head -10 "$FORMULA"
- name: Commit and push
run: |
VERSION=${{ steps.version.outputs.VERSION }}
cd homebrew-tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/rustconn.rb
# Idempotent: a re-run for the same version produces identical content,
# so skip the commit/push when nothing changed (avoids a failed
# "nothing to commit" exit on retry).
if git diff --cached --quiet; then
echo "Formula already up to date for ${VERSION} — nothing to commit"
else
git commit -m "rustconn ${VERSION}
Automated update from RustConn release v${VERSION}
https://github.com/totoshko88/RustConn/releases/tag/v${VERSION}"
git push
fi