refactor: Switch from CI/CD runners to Forgejo Packages distribution
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
Some checks are pending
Tests & Quality Checks / Test on Python 3.11 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-1 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.10 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.11-2 (push) Waiting to run
Tests & Quality Checks / Test on Python 3.12-2 (push) Waiting to run
Tests & Quality Checks / Build Artifacts (push) Blocked by required conditions
Tests & Quality Checks / Build Artifacts-1 (push) Blocked by required conditions
- Remove .forgejo/workflows/build.yml (not needed) - Remove FORGEJO_CI_CD_SETUP.md (runner approach obsolete) - Remove PHASE_3_3_CI_CD_SUMMARY.md (CI/CD approach replaced) - Add upload_to_packages.ps1 (Windows upload script) - Add upload_to_packages.sh (macOS upload script) - Add FORGEJO_PACKAGES_SETUP.md (comprehensive guide) - Update DEVELOPMENT_PLAN.md Phase 3.3 Rationale: - Simpler: No runner installation needed - More practical: Manual builds on local machines - More flexible: Build when you want - Same distribution hub: Forgejo Packages - Same auto-update integration: UpdateManager queries API Release workflow: 1. Build locally on Windows and macOS 2. Upload both to Forgejo Packages 3. Tag release: git tag v1.0.0 4. Users download from Packages page
This commit is contained in:
parent
39c6211edd
commit
7bf3a86f5c
7 changed files with 511 additions and 783 deletions
80
build/scripts/upload_to_packages.ps1
Normal file
80
build/scripts/upload_to_packages.ps1
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# Upload Windows Build to Forgejo Packages
|
||||
# Usage: .\upload_to_packages.ps1 -Version 1.0.0 -ForgejoToken $token
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Version,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$ForgejoToken,
|
||||
|
||||
[string]$ForgejoUrl = "https://git.him-tools.de",
|
||||
[string]$Repo = "HIM-public/webdrop-bridge",
|
||||
[string]$ExePath = "build\dist\windows\WebDropBridge.exe",
|
||||
[string]$ChecksumPath = "build\dist\windows\WebDropBridge.exe.sha256"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Verify files exist
|
||||
if (-not (Test-Path $ExePath)) {
|
||||
Write-Host "ERROR: Executable not found at $ExePath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (-not (Test-Path $ChecksumPath)) {
|
||||
Write-Host "ERROR: Checksum file not found at $ChecksumPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Uploading WebDropBridge $Version to Forgejo Packages..." -ForegroundColor Cyan
|
||||
|
||||
# Get file info
|
||||
$exeSize = (Get-Item $ExePath).Length / 1MB
|
||||
$checksum = Get-Content $ChecksumPath -Raw
|
||||
|
||||
Write-Host "File: WebDropBridge.exe ($([math]::Round($exeSize, 2)) MB)"
|
||||
Write-Host "Checksum: $($checksum.Substring(0, 16))..."
|
||||
|
||||
# Upload executable
|
||||
Write-Host "`nUploading executable..." -ForegroundColor Yellow
|
||||
$exeUrl = "$ForgejoUrl/api/v1/repos/$Repo/packages/generic/webdrop-bridge/$Version/WebDropBridge.exe"
|
||||
|
||||
$headers = @{
|
||||
"Authorization" = "token $ForgejoToken"
|
||||
}
|
||||
|
||||
try {
|
||||
$response = Invoke-WebRequest -Uri $exeUrl `
|
||||
-Method PUT `
|
||||
-Headers $headers `
|
||||
-InFile $ExePath `
|
||||
-ContentType "application/octet-stream"
|
||||
|
||||
Write-Host "✓ Executable uploaded successfully" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR uploading executable: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Upload checksum
|
||||
Write-Host "Uploading checksum..." -ForegroundColor Yellow
|
||||
$checksumUrl = "$ForgejoUrl/api/v1/repos/$Repo/packages/generic/webdrop-bridge/$Version/WebDropBridge.exe.sha256"
|
||||
|
||||
try {
|
||||
$response = Invoke-WebRequest -Uri $checksumUrl `
|
||||
-Method PUT `
|
||||
-Headers $headers `
|
||||
-Body $checksum `
|
||||
-ContentType "text/plain"
|
||||
|
||||
Write-Host "✓ Checksum uploaded successfully" -ForegroundColor Green
|
||||
}
|
||||
catch {
|
||||
Write-Host "ERROR uploading checksum: $_" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "`n✓ Upload complete!" -ForegroundColor Green
|
||||
Write-Host "View at: $ForgejoUrl/$Repo/packages" -ForegroundColor Cyan
|
||||
91
build/scripts/upload_to_packages.sh
Normal file
91
build/scripts/upload_to_packages.sh
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
#!/bin/bash
|
||||
# Upload macOS Build to Forgejo Packages
|
||||
# Usage: ./upload_to_packages.sh -v 1.0.0 -t $token
|
||||
|
||||
set -e
|
||||
|
||||
# Parse arguments
|
||||
VERSION=""
|
||||
FORGEJO_TOKEN=""
|
||||
FORGEJO_URL="https://git.him-tools.de"
|
||||
REPO="HIM-public/webdrop-bridge"
|
||||
DMG_PATH="build/dist/macos/WebDropBridge.dmg"
|
||||
CHECKSUM_PATH="build/dist/macos/WebDropBridge.dmg.sha256"
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-v|--version) VERSION="$2"; shift 2;;
|
||||
-t|--token) FORGEJO_TOKEN="$2"; shift 2;;
|
||||
-u|--url) FORGEJO_URL="$2"; shift 2;;
|
||||
*) echo "Unknown option: $1"; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$VERSION" ] || [ -z "$FORGEJO_TOKEN" ]; then
|
||||
echo "Usage: $0 -v VERSION -t TOKEN [-u FORGEJO_URL]"
|
||||
echo "Example: $0 -v 1.0.0 -t your_token_here"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify files exist
|
||||
if [ ! -f "$DMG_PATH" ]; then
|
||||
echo "ERROR: DMG file not found at $DMG_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$CHECKSUM_PATH" ]; then
|
||||
echo "ERROR: Checksum file not found at $CHECKSUM_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Uploading WebDropBridge $VERSION to Forgejo Packages..."
|
||||
|
||||
# Get file info
|
||||
DMG_SIZE=$(du -m "$DMG_PATH" | cut -f1)
|
||||
CHECKSUM=$(cat "$CHECKSUM_PATH")
|
||||
|
||||
echo "File: WebDropBridge.dmg ($DMG_SIZE MB)"
|
||||
echo "Checksum: ${CHECKSUM:0:16}..."
|
||||
|
||||
# Upload DMG
|
||||
echo ""
|
||||
echo "Uploading DMG..."
|
||||
DMG_URL="$FORGEJO_URL/api/v1/repos/$REPO/packages/generic/webdrop-bridge/$VERSION/WebDropBridge.dmg"
|
||||
|
||||
HTTP_CODE=$(curl -s -w "%{http_code}" -X PUT \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
--data-binary "@$DMG_PATH" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
"$DMG_URL" \
|
||||
-o /tmp/curl_response.txt)
|
||||
|
||||
if [ "$HTTP_CODE" -eq 201 ] || [ "$HTTP_CODE" -eq 200 ]; then
|
||||
echo "✓ DMG uploaded successfully"
|
||||
else
|
||||
echo "ERROR uploading DMG (HTTP $HTTP_CODE)"
|
||||
cat /tmp/curl_response.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload checksum
|
||||
echo "Uploading checksum..."
|
||||
CHECKSUM_URL="$FORGEJO_URL/api/v1/repos/$REPO/packages/generic/webdrop-bridge/$VERSION/WebDropBridge.dmg.sha256"
|
||||
|
||||
HTTP_CODE=$(curl -s -w "%{http_code}" -X PUT \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-d "$CHECKSUM" \
|
||||
-H "Content-Type: text/plain" \
|
||||
"$CHECKSUM_URL" \
|
||||
-o /tmp/curl_response.txt)
|
||||
|
||||
if [ "$HTTP_CODE" -eq 201 ] || [ "$HTTP_CODE" -eq 200 ]; then
|
||||
echo "✓ Checksum uploaded successfully"
|
||||
else
|
||||
echo "ERROR uploading checksum (HTTP $HTTP_CODE)"
|
||||
cat /tmp/curl_response.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✓ Upload complete!"
|
||||
echo "View at: $FORGEJO_URL/$REPO/packages"
|
||||
Loading…
Add table
Add a link
Reference in a new issue