Files
sshtermy/.github/workflows/release.yml
T
dependabot[bot] 023b9be5a3 intern: bump the actions group across 1 directory with 5 updates (#82)
Bumps the actions group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4` | `7` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5` | `7` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `7` |
| [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) | `3` | `5` |
| [actions/deploy-pages](https://github.com/actions/deploy-pages) | `4` | `5` |



Updates `actions/checkout` from 4 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

Updates `actions/setup-go` from 5 to 7
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v7)

Updates `actions/upload-artifact` from 4 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

Updates `actions/upload-pages-artifact` from 3 to 5
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

Updates `actions/deploy-pages` from 4 to 5
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-go
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-09 11:06:46 +01:00

125 lines
5.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: "1.26.x"
check-latest: true
- 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 }}
UPDATE_PUBKEY: ${{ vars.UPDATE_PUBKEY }}
if: env.UPDATE_SIGNING_KEY != ''
run: go run ./cmd/sshtermy-sign sign dist/checksums.txt
- name: Hinweis, wenn unsigniert
env:
UPDATE_SIGNING_KEY: ${{ secrets.UPDATE_SIGNING_KEY }}
UPDATE_PUBKEY: ${{ vars.UPDATE_PUBKEY }}
if: env.UPDATE_SIGNING_KEY == '' || env.UPDATE_PUBKEY == ''
run: |
# Public Key ohne Secret: die neue App würde jedes spätere Update ablehnen
if [ -n "$UPDATE_PUBKEY" ]; then
echo "::error title=Signierschlüssel fehlt::UPDATE_PUBKEY ist gesetzt, das Secret UPDATE_SIGNING_KEY fehlt – docs/signatur.md"
exit 1
fi
echo "::warning title=Release unsigniert::UPDATE_PUBKEY und UPDATE_SIGNING_KEY fehlen – Anleitung in docs/signatur.md"
- 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