feat: Add Forgejo CI/CD pipeline for automated builds and releases
- Create .forgejo/workflows/build.yml for automated Windows and macOS builds - Trigger on version tags (v1.0.0, v1.0.1, etc.) or manual dispatch - Windows job builds executable with PyInstaller - macOS job builds DMG package - Automatically generate SHA256 checksums for verification - Create release on Forgejo with all artifacts - Add FORGEJO_CI_CD_SETUP.md with complete setup guide - Add CHANGELOG.md for version tracking - Update DEVELOPMENT_PLAN.md with Phase 3.3 details This enables: - Centralized release hub on Forgejo - Automatic distribution of builds - Foundation for Phase 4.1 auto-update system - Checksum-based integrity verification
This commit is contained in:
parent
db0cef4797
commit
00b4c55612
4 changed files with 622 additions and 0 deletions
212
.forgejo/workflows/build.yml
Normal file
212
.forgejo/workflows/build.yml
Normal file
|
|
@ -0,0 +1,212 @@
|
|||
name: Build WebDrop Bridge
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
name: Build Windows Executable
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements-dev.txt
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
python -m pytest tests -v --tb=short
|
||||
|
||||
- name: Build Windows executable
|
||||
run: |
|
||||
python build/scripts/build_windows.py
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
$file = "build\dist\windows\WebDropBridge.exe"
|
||||
$hash = (Get-FileHash -Path $file -Algorithm SHA256).Hash
|
||||
$hash | Out-File -FilePath "build\dist\windows\WebDropBridge.exe.sha256" -NoNewline
|
||||
Write-Host "SHA256: $hash"
|
||||
|
||||
- name: Upload Windows artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: windows-build
|
||||
path: |
|
||||
build/dist/windows/WebDropBridge.exe
|
||||
build/dist/windows/WebDropBridge.exe.sha256
|
||||
|
||||
build-macos:
|
||||
name: Build macOS DMG
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements-dev.txt
|
||||
brew install create-dmg
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
python -m pytest tests -v --tb=short
|
||||
|
||||
- name: Build macOS DMG
|
||||
run: |
|
||||
bash build/scripts/build_macos.sh
|
||||
|
||||
- name: Generate checksum
|
||||
run: |
|
||||
file="build/dist/macos/WebDropBridge.dmg"
|
||||
hash=$(shasum -a 256 "$file" | awk '{print $1}')
|
||||
echo "$hash" > "build/dist/macos/WebDropBridge.dmg.sha256"
|
||||
echo "SHA256: $hash"
|
||||
|
||||
- name: Upload macOS artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: macos-build
|
||||
path: |
|
||||
build/dist/macos/WebDropBridge.dmg
|
||||
build/dist/macos/WebDropBridge.dmg.sha256
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
needs: [build-windows, build-macos]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download Windows artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-build
|
||||
path: artifacts/windows
|
||||
|
||||
- name: Download macOS artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-build
|
||||
path: artifacts/macos
|
||||
|
||||
- name: Get version from tag
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||
release_name: Release ${{ steps.get_version.outputs.VERSION }}
|
||||
body: |
|
||||
# WebDrop Bridge ${{ steps.get_version.outputs.VERSION }}
|
||||
|
||||
## Downloads
|
||||
|
||||
### Windows
|
||||
- **WebDropBridge.exe** - Standalone executable
|
||||
- SHA256: See WebDropBridge.exe.sha256
|
||||
|
||||
### macOS
|
||||
- **WebDropBridge.dmg** - DMG package
|
||||
- SHA256: See WebDropBridge.dmg.sha256
|
||||
|
||||
## Installation
|
||||
|
||||
### Windows
|
||||
1. Download `WebDropBridge.exe`
|
||||
2. Run the executable
|
||||
3. No installation required - it's portable
|
||||
|
||||
### macOS
|
||||
1. Download `WebDropBridge.dmg`
|
||||
2. Open the DMG file
|
||||
3. Drag WebDropBridge.app to Applications
|
||||
|
||||
## Verification
|
||||
|
||||
To verify the integrity of downloaded files:
|
||||
|
||||
```bash
|
||||
# Windows (PowerShell)
|
||||
$file = "WebDropBridge.exe"
|
||||
$expected = Get-Content "WebDropBridge.exe.sha256"
|
||||
$actual = (Get-FileHash -Path $file -Algorithm SHA256).Hash
|
||||
if ($actual -eq $expected) { Write-Host "OK" } else { Write-Host "MISMATCH" }
|
||||
|
||||
# macOS/Linux
|
||||
shasum -c WebDropBridge.dmg.sha256
|
||||
```
|
||||
|
||||
## What's New
|
||||
|
||||
See [CHANGELOG.md](CHANGELOG.md) for details.
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Windows executable
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: artifacts/windows/WebDropBridge.exe
|
||||
asset_name: WebDropBridge.exe
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
- name: Upload Windows checksum
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: artifacts/windows/WebDropBridge.exe.sha256
|
||||
asset_name: WebDropBridge.exe.sha256
|
||||
asset_content_type: text/plain
|
||||
|
||||
- name: Upload macOS DMG
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: artifacts/macos/WebDropBridge.dmg
|
||||
asset_name: WebDropBridge.dmg
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
- name: Upload macOS checksum
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: artifacts/macos/WebDropBridge.dmg.sha256
|
||||
asset_name: WebDropBridge.dmg.sha256
|
||||
asset_content_type: text/plain
|
||||
Loading…
Add table
Add a link
Reference in a new issue