diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml new file mode 100644 index 0000000..176ada5 --- /dev/null +++ b/.github/workflows/windows_release.yml @@ -0,0 +1,109 @@ +name: Windows Release + +# Continuous Windows portable build on every push to main. +# Uses GitHub-hosted windows-latest (MSVC preinstalled). +# See docs/windows-runner.md + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: infinipaint-windows-release + cancel-in-progress: true + +jobs: + windows-x86_64: + runs-on: windows-latest + timeout-minutes: 360 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install Conan + shell: pwsh + run: | + python -m pip install --upgrade pip + python -m pip install "conan>=2,<3" + conan --version + + - name: Resolve version + id: ver + shell: bash + run: | + set -euo pipefail + ver="$(grep -E 'CURRENT_VERSION_STRING' src/VersionConstants.hpp | head -1 | sed -E 's/.*"([^"]+)".*/\1/')" + short_sha="$(echo "${GITHUB_SHA}" | cut -c1-7)" + asset_ver="${ver}+${short_sha}" + zip_name="infinipaint-${asset_ver}-win-x86_64-portable.zip" + { + echo "version=${ver}" + echo "tag=windows-continuous" + echo "asset_ver=${asset_ver}" + echo "zip_name=${zip_name}" + } >> "$GITHUB_OUTPUT" + + - name: Build Windows x86_64 + shell: cmd + run: | + call windowsinstall\conan_init_x86_64.bat + if errorlevel 1 exit /b 1 + call windowsinstall\build_x86_64.bat + if errorlevel 1 exit /b 1 + + - name: Package portable zip + id: pkg + shell: pwsh + env: + ZIP_NAME: ${{ steps.ver.outputs.zip_name }} + run: | + $ErrorActionPreference = "Stop" + $exe = Get-ChildItem -Path . -Recurse -Filter infinipaint.exe | + Where-Object { $_.FullName -match 'Release' } | + Select-Object -First 1 + if (-not $exe) { throw "infinipaint.exe not found under Release" } + $outDir = Join-Path (Get-Location) "dist\portable" + Remove-Item -Recurse -Force $outDir -ErrorAction SilentlyContinue + New-Item -ItemType Directory -Force -Path $outDir | Out-Null + Copy-Item $exe.FullName (Join-Path $outDir "infinipaint.exe") + $dllDir = Join-Path (Get-Location) "windowsinstall\dlls-x86_64" + if (Test-Path $dllDir) { + Copy-Item (Join-Path $dllDir "*.dll") $outDir -ErrorAction SilentlyContinue + } + $dataSrc = Join-Path (Get-Location) "assets\data" + if (-not (Test-Path $dataSrc)) { $dataSrc = Join-Path (Get-Location) "data" } + Copy-Item -Recurse $dataSrc (Join-Path $outDir "data") + New-Item -ItemType Directory -Force -Path "dist" | Out-Null + $zipPath = Join-Path (Get-Location) "dist\$env:ZIP_NAME" + if (Test-Path $zipPath) { Remove-Item $zipPath } + Compress-Archive -Path (Join-Path $outDir "*") -DestinationPath $zipPath + "zip_path=$zipPath" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + Get-Item $zipPath | Format-List FullName, Length + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.ver.outputs.tag }} + name: Windows continuous (${{ steps.ver.outputs.asset_ver }}) + prerelease: true + body: | + Continuous Windows build from `main`. + + - Version: **${{ steps.ver.outputs.version }}** + - Commit: `${{ github.sha }}` + - Asset: `${{ steps.ver.outputs.zip_name }}` + + Updated on every push to `main`. Built on GitHub-hosted `windows-latest`. + files: dist/${{ steps.ver.outputs.zip_name }} + fail_on_unmatched_files: true diff --git a/FORK.md b/FORK.md index 10b3ef3..2e44529 100644 --- a/FORK.md +++ b/FORK.md @@ -1,7 +1,8 @@ # Fork features (copilot/infinipaint) Upstream: [ErrorAtLine0/infinipaint](https://github.com/ErrorAtLine0/infinipaint) -Forgejo: https://forgejo.fsociety00.cc/copilot/infinipaint (public) +Forgejo: https://forgejo.fsociety00.cc/copilot/infinipaint (public) +GitHub (CI / Windows zip): https://github.com/littlecodedragon/infinipaint Save format: `INFPNT000007` / version `0.7.0-fork` (not network-compatible with stock 0.6.x peers). @@ -9,10 +10,11 @@ Save format: `INFPNT000007` / version `0.7.0-fork` (not network-compatible with | Workflow | Trigger | Runner | Output | |----------|---------|--------|--------| -| `.forgejo/workflows/windows_release.yml` | every push to `main` | **`windows-release`** (Windows + MSVC) | prerelease tag `windows-continuous` | +| `.github/workflows/windows_release.yml` | every push to `main` | GitHub-hosted **`windows-latest`** | prerelease tag `windows-continuous` | +| `.forgejo/workflows/windows_release.yml` | every push to `main` | Forgejo self-hosted `windows-release` (optional) | same tag on Forgejo | -Register a Windows self-hosted runner: [docs/windows-runner.md](docs/windows-runner.md). -Jobs queue until that runner is online (Tower dual-boots Windows). +Primary path: GitHub Actions — see [docs/windows-runner.md](docs/windows-runner.md). +Download: https://github.com/littlecodedragon/infinipaint/releases/tag/windows-continuous ## Bring Everyone Here (host) diff --git a/README.md b/README.md index be82bbf..b65612f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ InfiniPaint is a **collaborative, infinite** canvas note-taking/drawing app. Unlike many other infinite canvas apps, **there is no zoom-in or zoom-out limit** (at least up until the point your computer runs out of memory). This means that this app is very good at things such as drawing sketches of the solar system to scale, or just drawing any massive objects with tiny details. Of course, even though this is a feature, this app is also perfectly well suited for use as a normal canvas. -> **This repository is a fork** hosted at [forgejo.fsociety00.cc/copilot/infinipaint](https://forgejo.fsociety00.cc/copilot/infinipaint). Extra features (host view sync, grouping, image compression, freistellen) are documented in [FORK.md](FORK.md). +> **This repository is a fork** — Forgejo: [copilot/infinipaint](https://forgejo.fsociety00.cc/copilot/infinipaint), GitHub (Windows CI): [littlecodedragon/infinipaint](https://github.com/littlecodedragon/infinipaint). Extra features are documented in [FORK.md](FORK.md). You can try the web version of this app at [infinipaint.com](https://infinipaint.com) (requires a WebGL2 capable browser). The web version was compiled from C++ to Javascript using Emscripten, and may contain some bugs, so if possible, please consider downloading the native version for a better experience. diff --git a/docs/windows-runner.md b/docs/windows-runner.md index cc8a6ee..b0d7bbe 100644 --- a/docs/windows-runner.md +++ b/docs/windows-runner.md @@ -1,24 +1,37 @@ -# Windows Forgejo runner (`windows-release`) +# Windows continuous release (GitHub Actions) -Tower dual-boots Windows. Native InfiniPaint Windows builds need **MSVC 2022** -(see `docs/BUILDING.md` + `windowsinstall/`). There is no Linux cross-build path. +Native InfiniPaint Windows builds need **MSVC** (see `docs/BUILDING.md` + +`windowsinstall/`). There is no Linux cross-build path. -## One-time setup (on Windows) +The fork publishes a portable zip from a **GitHub** repository using the +GitHub-hosted runner `windows-latest` (Visual Studio / MSVC preinstalled). -1. Install Visual Studio 2022 Build Tools (C++), CMake, Git, Python 3. -2. `pip install "conan>=2,<3"`. -3. Download [forgejo-runner](https://code.forgejo.org/forgejo/runner/releases) for Windows. -4. Register against `https://forgejo.fsociety00.cc` with label **`windows-release`** - (repo or org runner; Actions must be enabled — already on for `copilot/infinipaint`). -5. Run the runner as a service or in a logged-on session when you want CI to drain. +## Workflow -## Behaviour +File: `.github/workflows/windows_release.yml` -Workflow: `.forgejo/workflows/windows_release.yml` +| | | +|---|---| +| Trigger | every push to `main`, plus `workflow_dispatch` | +| Runner | `windows-latest` (GitHub-hosted) | +| Build | `windowsinstall/conan_init_x86_64.bat` + `build_x86_64.bat` | +| Output | prerelease tag **`windows-continuous`** with a portable zip | -- Triggers on every push to `main` (and `workflow_dispatch`) -- Builds x86_64 portable zip via `windowsinstall/*_x86_64.bat` -- Publishes/updates prerelease tag **`windows-continuous`** +## GitHub remote -Jobs stay queued in Forgejo until a `windows-release` runner is online -(same pattern as `desktop-release` capacity/queue on Tower Linux). +Recommended remote name: `github` + +```bash +git remote add github https://github.com/littlecodedragon/infinipaint.git +git push -u github main +``` + +Releases appear under: +https://github.com/littlecodedragon/infinipaint/releases/tag/windows-continuous + +## Forgejo note + +`.forgejo/workflows/windows_release.yml` still targets a Forgejo self-hosted +label `windows-release` (Tower dual-boot). Prefer the GitHub workflow above for +unattended continuous Windows zips; keep Forgejo for the public forge mirror if +desired.