Compare commits
No commits in common. "main" and "v0.1.3" have entirely different histories.
2 changed files with 37 additions and 122 deletions
157
.github/workflows/build.yml
vendored
157
.github/workflows/build.yml
vendored
|
|
@ -1,23 +1,11 @@
|
||||||
name: Windows Installer bauen
|
name: Windows Installer bauen
|
||||||
|
|
||||||
# Von GitHub Actions auf selbstgehostete Forgejo Actions umgestellt (Windows
|
|
||||||
# Runner rcp-24, derselbe Runner wie NovaStudioCast, siehe NOVA-SERVER/forgejo-runner).
|
|
||||||
# Zwei Aenderungen gegenueber der alten GitHub Version:
|
|
||||||
# 1. dtolnay/rust-toolchain ist auf dieser Forgejo Instanz nicht gespiegelt
|
|
||||||
# (nur die offiziellen actions/* Actions sind das), deshalb Rust hier
|
|
||||||
# direkt per rustup eingerichtet.
|
|
||||||
# 2. tauri-apps/tauri-action ist ebenfalls nicht gespiegelt, deshalb wird bei
|
|
||||||
# einem Versions-Tag von Hand gebaut, signiert und als Forgejo Release
|
|
||||||
# veroeffentlicht (Installer + latest.json), statt diese GitHub Action zu
|
|
||||||
# nutzen. "npm run tauri build" erzeugt bei gesetzten
|
|
||||||
# TAURI_SIGNING_PRIVATE_KEY(_PASSWORD) Umgebungsvariablen automatisch eine
|
|
||||||
# .sig Signaturdatei neben dem Installer, unabhaengig von tauri-action.
|
|
||||||
# actions/upload-artifact bewusst bei v3 belassen, v4+ wird von Forgejo nicht
|
|
||||||
# unterstuetzt (GHESNotSupportedError, siehe NovaStudioCast build.yml).
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'tauri-app/**'
|
||||||
|
- '.github/workflows/build.yml'
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
@ -43,11 +31,7 @@ jobs:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: Rust einrichten
|
- name: Rust einrichten
|
||||||
shell: pwsh
|
uses: dtolnay/rust-toolchain@stable
|
||||||
run: |
|
|
||||||
rustup toolchain install stable --profile minimal
|
|
||||||
rustup default stable
|
|
||||||
rustup target add x86_64-pc-windows-msvc
|
|
||||||
|
|
||||||
- name: Node Abhängigkeiten installieren
|
- name: Node Abhängigkeiten installieren
|
||||||
working-directory: tauri-app
|
working-directory: tauri-app
|
||||||
|
|
@ -115,7 +99,7 @@ jobs:
|
||||||
|
|
||||||
- name: Installer als Artefakt hochladen (nur bei normalem Push)
|
- name: Installer als Artefakt hochladen (nur bei normalem Push)
|
||||||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: novaphonic-windows-installer
|
name: novaphonic-windows-installer
|
||||||
path: |
|
path: |
|
||||||
|
|
@ -124,108 +108,39 @@ jobs:
|
||||||
- name: Änderungsliste seit dem letzten Tag ermitteln (nur bei Versions-Tag)
|
- name: Änderungsliste seit dem letzten Tag ermitteln (nur bei Versions-Tag)
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
id: changelog
|
id: changelog
|
||||||
shell: pwsh
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
$ErrorActionPreference = "Stop"
|
set -e
|
||||||
$currentTag = "${{ github.ref_name }}"
|
CURRENT_TAG="${GITHUB_REF_NAME}"
|
||||||
$prevTag = git tag --sort=-v:refname | Where-Object { $_ -ne $currentTag } | Select-Object -First 1
|
PREV_TAG=$(git tag --sort=-v:refname | grep -v "^${CURRENT_TAG}$" | head -n 1)
|
||||||
Write-Host "Aktueller Tag: $currentTag"
|
echo "Aktueller Tag: ${CURRENT_TAG}"
|
||||||
Write-Host "Vorheriger Tag: $(if ($prevTag) { $prevTag } else { 'keiner, es ist das erste Release' })"
|
echo "Vorheriger Tag: ${PREV_TAG:-keiner, es ist das erste Release}"
|
||||||
if ($prevTag) {
|
{
|
||||||
$log = git log --pretty=format:"- %s" "$prevTag..$currentTag"
|
echo "changelog<<CHANGELOG_EOF"
|
||||||
} else {
|
if [ -n "$PREV_TAG" ]; then
|
||||||
$log = git log --pretty=format:"- %s" "$currentTag"
|
git log --pretty=format:"- %s" "${PREV_TAG}..${CURRENT_TAG}"
|
||||||
}
|
else
|
||||||
$changelog = "changelog<<CHANGELOG_EOF`n$($log -join "`n")`nCHANGELOG_EOF"
|
git log --pretty=format:"- %s" "${CURRENT_TAG}"
|
||||||
Add-Content -Path $env:GITHUB_OUTPUT -Value $changelog
|
fi
|
||||||
|
echo ""
|
||||||
|
echo "CHANGELOG_EOF"
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Versionsnummer aus Tag automatisch setzen (nur bei Versions-Tag)
|
- name: Bauen, signieren und GitHub Release veröffentlichen (nur bei Versions-Tag)
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
working-directory: tauri-app
|
uses: tauri-apps/tauri-action@v0
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$ErrorActionPreference = "Stop"
|
|
||||||
$version = "${{ github.ref_name }}" -replace '^v', ''
|
|
||||||
Write-Host "Setze Version auf $version in tauri.conf.json, package.json, Cargo.toml ..."
|
|
||||||
|
|
||||||
$confPath = "src-tauri/tauri.conf.json"
|
|
||||||
$content = Get-Content $confPath -Raw
|
|
||||||
$neu = $content -replace '("version"\s*:\s*)"[^"]*"', "`$1`"$version`""
|
|
||||||
if ($neu -eq $content) { Write-Error "Version in $confPath nicht gefunden/ersetzt." }
|
|
||||||
Set-Content -Path $confPath -Value $neu -NoNewline
|
|
||||||
|
|
||||||
$pkgPath = "package.json"
|
|
||||||
$content = Get-Content $pkgPath -Raw
|
|
||||||
$neu = $content -replace '("version"\s*:\s*)"[^"]*"', "`$1`"$version`""
|
|
||||||
if ($neu -eq $content) { Write-Error "Version in $pkgPath nicht gefunden/ersetzt." }
|
|
||||||
Set-Content -Path $pkgPath -Value $neu -NoNewline
|
|
||||||
|
|
||||||
$cargoPath = "src-tauri/Cargo.toml"
|
|
||||||
$content = Get-Content $cargoPath -Raw
|
|
||||||
$neu = $content -replace '(?m)^version = "[^"]*"', "version = `"$version`""
|
|
||||||
if ($neu -eq $content) { Write-Error "Version in $cargoPath nicht gefunden/ersetzt." }
|
|
||||||
Set-Content -Path $cargoPath -Value $neu -NoNewline
|
|
||||||
|
|
||||||
Write-Host " Erledigt, alle drei Dateien jetzt auf $version."
|
|
||||||
|
|
||||||
- name: Bauen und signieren (nur bei Versions-Tag)
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
working-directory: tauri-app
|
|
||||||
run: npm run tauri build
|
|
||||||
|
|
||||||
- name: Forgejo Release veröffentlichen (nur bei Versions-Tag)
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
shell: pwsh
|
|
||||||
env:
|
env:
|
||||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_RELEASE_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
|
with:
|
||||||
run: |
|
projectPath: tauri-app
|
||||||
$ErrorActionPreference = "Stop"
|
tagName: ${{ github.ref_name }}
|
||||||
$repoApi = "https://forgejo.kiw-schmiede.eu/api/v1/repos/kiw-schmiede/novaphonic"
|
releaseName: 'NovaPhonic ${{ github.ref_name }}'
|
||||||
$headers = @{ Authorization = "token $env:FORGEJO_TOKEN" }
|
releaseBody: |
|
||||||
$tag = "${{ github.ref_name }}"
|
NovaPhonic ${{ github.ref_name }}. Enthält den Windows Installer sowie das Update Manifest für die In App Aktualisierung.
|
||||||
|
|
||||||
$bundleDir = "tauri-app/src-tauri/target/release/bundle/nsis"
|
Änderungen in diesem Release:
|
||||||
$installer = Get-ChildItem -Path $bundleDir -Filter "*.exe" | Select-Object -First 1
|
${{ steps.changelog.outputs.changelog }}
|
||||||
$sigFile = "$($installer.FullName).sig"
|
releaseDraft: false
|
||||||
if (-not (Test-Path $sigFile)) {
|
prerelease: false
|
||||||
Write-Error "Keine .sig Datei neben $($installer.Name) gefunden, Signierung ist vermutlich fehlgeschlagen (TAURI_SIGNING_PRIVATE_KEY gesetzt?)."
|
includeUpdaterJson: true
|
||||||
}
|
generateReleaseNotes: false
|
||||||
$signature = Get-Content $sigFile -Raw
|
|
||||||
|
|
||||||
Write-Host "Lege Forgejo Release fuer $tag an ..."
|
|
||||||
$releaseBody = @{
|
|
||||||
tag_name = $tag
|
|
||||||
name = "NovaPhonic $tag"
|
|
||||||
body = "NovaPhonic $tag. Enthaelt den Windows Installer sowie das Update Manifest fuer die In App Aktualisierung.`n`nAenderungen in diesem Release:`n$env:CHANGELOG"
|
|
||||||
draft = $false
|
|
||||||
prerelease = $false
|
|
||||||
} | ConvertTo-Json
|
|
||||||
$release = Invoke-RestMethod -Uri "$repoApi/releases" -Method Post -Headers $headers -ContentType "application/json" -Body $releaseBody
|
|
||||||
Write-Host " Release ID $($release.id) angelegt."
|
|
||||||
|
|
||||||
Write-Host "Lade Installer hoch ..."
|
|
||||||
$installerUploadUrl = "$repoApi/releases/$($release.id)/assets?name=$($installer.Name)"
|
|
||||||
Invoke-RestMethod -Uri $installerUploadUrl -Method Post -Headers $headers -Form @{ attachment = Get-Item $installer.FullName } | Out-Null
|
|
||||||
|
|
||||||
$installerAsset = (Invoke-RestMethod -Uri "$repoApi/releases/$($release.id)" -Headers $headers).assets | Where-Object { $_.name -eq $installer.Name }
|
|
||||||
|
|
||||||
Write-Host "Baue latest.json (Update Manifest) ..."
|
|
||||||
$latestJson = @{
|
|
||||||
version = $tag
|
|
||||||
notes = "NovaPhonic $tag"
|
|
||||||
pub_date = (Get-Date -AsUTC -Format "yyyy-MM-ddTHH:mm:ssZ")
|
|
||||||
platforms = @{
|
|
||||||
"windows-x86_64" = @{
|
|
||||||
signature = $signature
|
|
||||||
url = $installerAsset.browser_download_url
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} | ConvertTo-Json -Depth 5
|
|
||||||
Set-Content -Path "latest.json" -Value $latestJson -NoNewline
|
|
||||||
|
|
||||||
Write-Host "Lade latest.json hoch ..."
|
|
||||||
$manifestUploadUrl = "$repoApi/releases/$($release.id)/assets?name=latest.json"
|
|
||||||
Invoke-RestMethod -Uri $manifestUploadUrl -Method Post -Headers $headers -Form @{ attachment = Get-Item "latest.json" } | Out-Null
|
|
||||||
|
|
||||||
Write-Host "Fertig: https://forgejo.kiw-schmiede.eu/kiw-schmiede/novaphonic/releases/tag/$tag"
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEE1NzVEMkZBOEM1NDhGRApSV1Q5U01Xb0wxMVhDaENFOHRPV29oeUxkdmEzYkQ1NTV6NHE0NHUwbERYeUliRkErVXBoU3AvTwo=",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDMxOUJBODQxRTFFMzNFRjcKUldUM1B1UGhRYWliTVIySHBRUno3R2NvSC9SV2hzV1BXVFp3Rit5eThhSVBvdmxJM1k3ZzBLV1oK",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://github.com/kiwerkepro-org/novaphonic/releases/latest/download/latest.json"
|
"https://github.com/kiwerkepro-org/novaphonic/releases/latest/download/latest.json"
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue