mirror of
https://github.com/db9979/sshtermy.git
synced 2026-12-06 04:34:08 +01:00
- Release, CI und Makefile bauen zusätzlich linux/arm (ARMv7) und linux/riscv64, dazu .deb für armhf und riscv64; install.sh erkennt beide. - Kopfzeile lässt bei schmalem Fenster Teile weg (Leitung, Modellname, Host-Werte, leere Tunnelanzeige), statt mitten im Text abzuschneiden. - Hilfe: bei wenigen Zeilen blättern Warnung und Hinweis mit. - README/Webseite: Abschnitt ClockworkPi uConsole (Fn-Tasten). - prepare.py an das Formular mit Protokollzeile angepasst. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018i4GUkA7hSNs6TaCBWJh4K
110 lines
4.3 KiB
YAML
110 lines
4.3 KiB
YAML
# Bei jedem Push auf main: testen, Version hochzählen (MAJOR.MINOR aus VERSION,
|
|
# PATCH = Anzahl Commits), für alle Plattformen bauen, signieren und als
|
|
# GitHub Release veröffentlichen. Die App findet das Release per Auto-Update.
|
|
# Dazu: .deb-Pakete (apt-Quelle baut pages.yml) und die Homebrew-Formel
|
|
# (Formula/sshtermy.rb, dieses Repo ist der Tap). winget: winget.yml.
|
|
name: release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore: ["docs/**", "site/**", "Formula/**", "**.md"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read # PR-Beschreibungen für den Changelog
|
|
|
|
concurrency:
|
|
group: release
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Tests
|
|
run: go vet ./... && go test ./...
|
|
|
|
- name: Version bestimmen
|
|
id: v
|
|
run: |
|
|
V="$(cat VERSION).$(git rev-list --count HEAD)"
|
|
echo "version=$V" >> "$GITHUB_OUTPUT"
|
|
echo "sshTermy v$V"
|
|
|
|
- name: Changelog erzeugen („Was ist neu“ in der App + Release-Notizen)
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
go run ./tools/changelog -out internal/changelog/CHANGELOG.md -notes notes.md
|
|
head -20 internal/changelog/CHANGELOG.md
|
|
|
|
- name: Bauen (windows arm64/386/amd64, darwin arm64/amd64, linux amd64/arm64/arm/riscv64)
|
|
env:
|
|
UPDATE_PUBKEY: ${{ vars.UPDATE_PUBKEY }}
|
|
run: |
|
|
PKG=github.com/db9979/sshtermy/internal/version
|
|
LDF="-s -w -X $PKG.Version=${{ steps.v.outputs.version }} -X $PKG.Commit=${GITHUB_SHA::7} -X $PKG.Date=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X $PKG.UpdatePubKey=$UPDATE_PUBKEY"
|
|
mkdir -p dist
|
|
for t in windows/arm64 windows/386 windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 linux/arm linux/riscv64; do
|
|
os=${t%/*}; arch=${t#*/}; ext=""; [ "$os" = windows ] && ext=".exe"
|
|
# linux/arm = 32-Bit-ARMv7 (Raspberry Pi OS armhf, z. B. uConsole mit CM3/CM4)
|
|
CGO_ENABLED=0 GOARM=7 GOOS=$os GOARCH=$arch go build -trimpath -ldflags "$LDF" -o "dist/sshtermy_${os}_${arch}${ext}" ./cmd/sshtermy
|
|
done
|
|
cd dist && sha256sum sshtermy_* > checksums.txt && cat checksums.txt
|
|
|
|
- name: Debian-Pakete (amd64, arm64, armhf, riscv64)
|
|
run: |
|
|
for a in amd64 arm64 armhf riscv64; do
|
|
b=$a; [ $a = armhf ] && b=arm
|
|
packaging/deb.sh ${{ steps.v.outputs.version }} $a dist/sshtermy_linux_$b dist
|
|
done
|
|
cd dist && sha256sum sshtermy_* > checksums.txt && cat checksums.txt
|
|
|
|
- name: Signieren (Ed25519)
|
|
env:
|
|
UPDATE_SIGNING_KEY: ${{ secrets.UPDATE_SIGNING_KEY }}
|
|
if: env.UPDATE_SIGNING_KEY != ''
|
|
run: go run ./cmd/sshtermy-sign sign dist/checksums.txt
|
|
|
|
- name: Release veröffentlichen
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
V=${{ steps.v.outputs.version }}
|
|
gh release create "v$V" dist/sshtermy_* dist/checksums.txt* --title "sshTermy v$V" --notes-file notes.md --latest
|
|
|
|
- name: Alte Releases aufräumen (die letzten 10 bleiben)
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
gh release list --limit 100 --json tagName --jq '.[10:][].tagName' | while read -r tag; do
|
|
gh release delete "$tag" --yes --cleanup-tag || true
|
|
done
|
|
|
|
- name: Homebrew-Formel aktualisieren (Formula/sshtermy.rb in main)
|
|
continue-on-error: true # z. B. Branch-Schutz: Release ist trotzdem draußen
|
|
run: |
|
|
V=${{ steps.v.outputs.version }}
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
for i in 1 2 3 4; do
|
|
git fetch -q origin main && git checkout -q -f -B formula origin/main
|
|
mkdir -p Formula && packaging/formula.sh "$V" dist/checksums.txt > Formula/sshtermy.rb
|
|
git add Formula/sshtermy.rb
|
|
git diff --cached --quiet && exit 0
|
|
git commit -q -m "Homebrew-Formel für v$V"
|
|
git push -q origin HEAD:main && exit 0
|
|
sleep $((i * 3))
|
|
done
|
|
exit 1
|