mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 00:11:05 +00:00
This changes release workflows (house rule 9). It only adds limits, but
it needs a maintainer's look before merging.
## Problem
`artcraft-macos-publish.yml` and `artcraft-windows-publish.yml` have no
`concurrency` and no `timeout-minutes`. `artcraft-linux-publish.yml`
already has both.
- **Overlapping builds:** two pushes to `release` or `artcraft-release`
in quick succession start two builds of the same platform side by side.
Both create or update the same `artcraft-v<version>` draft release
through `tauri-action`. Nothing stops this today. It happens whenever a
second push lands while a 10-36 minute build is still running. (The two
runs on 2026-11-07 were 35 minutes apart and did not overlap.)
- **Hung builds:** a build that hangs runs until GitHub's 6-hour
default. The Windows run on 2026-06-12 did exactly that and was
cancelled at 360 minutes. Successful builds take far less:
| workflow | successful builds, last 15 runs (2026-04 to 2026-11) |
|---|---|
| macOS publish | 10-22 min |
| Windows publish | 17-36 min |
## Change
Two files, limits only. Triggers, steps, secrets, signing, release
settings and action versions are unchanged.
- **Concurrency:** `concurrency: { group: macos-release-${{ github.ref
}}, cancel-in-progress: false }`, and likewise `windows-release-…`. This
is the same pattern as `artcraft-linux-publish.yml` (`linux-release-${{
github.ref }}`).
- A release build that is already running is **never cancelled**, since
it may already have uploaded to the draft release.
- One GitHub behaviour to be aware of: a concurrency group holds one
running and one pending run. If a third push lands while one build runs
and another waits, GitHub replaces the waiting run with the newest. So
the next build is always of the latest commit on that branch, and an
intermediate commit may not get its own build. For a release branch I
think that is what we want. If every commit must get a build, this PR
shouldn't be merged as it is; tell me and I'll change it.
- The groups are per platform and per branch, so macOS, Windows and
Linux still build in parallel with each other.
- **Timeouts:** `timeout-minutes: 60` for macOS and `90` for Windows.
That is about 2.5-3× the slowest successful build, and Windows matches
the Linux build job's 90. A hang now stops after an hour or an hour and
a half instead of six.
Not changed: `dtolnay/rust-toolchain@stable` and
`tauri-apps/tauri-action@v0` are still unpinned tags. Pinning them would
change which action code builds a release, so it should be a separate
decision.
## Verification
- `actionlint` is clean on the three publish workflows.
- These workflows only run on pushes to `release`, `artcraft-release`,
`artcraft-macos` and `artcraft-windows`, so this PR's checks don't
exercise them. The new settings take effect on the next release push.
- I didn't trigger a release build.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Chores**
* Release builds for macOS and Windows now finish in progress without
being cancelled by newer runs. When multiple builds are queued for the
same branch or ref, only the newest pending build is kept.
* Publishing jobs now have maximum run times of 60 minutes for macOS and
90 minutes for Windows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: FredApps <FredApps@users.noreply.github.com>
119 lines
3.8 KiB
YAML
119 lines
3.8 KiB
YAML
name: "Artcraft Windows Publish"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- release
|
|
- artcraft-release
|
|
- artcraft-windows # Additional branch for Windows testing
|
|
|
|
# This workflow creates Windows builds.
|
|
# On each push to the release branches it will create or update a GitHub release, build your app, and upload the artifacts to the release.
|
|
|
|
# One release build per branch at a time. A run in progress is never cancelled, because it may
|
|
# already have created or uploaded to the draft release. If more pushes arrive while one runs,
|
|
# GitHub keeps only the newest as pending, so the next build is of the latest commit.
|
|
concurrency:
|
|
group: windows-release-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
publish-artcraft-windows:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# Windows builds
|
|
- platform: 'windows-latest'
|
|
args: ''
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
# Successful builds took 17-36 min (2026-04 to 2026-11); one hung run used the full 6-hour default.
|
|
timeout-minutes: 90
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: install wreq dependencies
|
|
run: |
|
|
choco install cmake -y
|
|
choco install strawberryperl -y
|
|
choco install pkgconfiglite -y
|
|
choco install llvm -y
|
|
choco install nasm -y
|
|
shell: cmd
|
|
|
|
- name: setup node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: install frontend dependencies
|
|
shell: pwsh
|
|
run: |
|
|
# Navigate to the frontend directory to install dependencies
|
|
cd ./frontend
|
|
|
|
npm cache clean --force
|
|
|
|
echo "Installing all workspace dependencies..."
|
|
npm ci
|
|
|
|
echo "=== Version Information ==="
|
|
echo "Node version:"
|
|
node --version
|
|
echo "NPM version:"
|
|
npm --version
|
|
|
|
echo "=== Nx versions from lockfile ==="
|
|
npm list --depth=0 | findstr nx
|
|
|
|
- name: Pre-build frontend to avoid Tauri build issues
|
|
shell: pwsh
|
|
run: |
|
|
# Build the frontend app from the correct directory
|
|
cd ./frontend
|
|
|
|
# Increase Node.js memory limit for the build
|
|
$env:NODE_OPTIONS="--max-old-space-size=8192"
|
|
|
|
# Use npx to ensure we use the local nx version
|
|
echo "Building with npx nx..."
|
|
npx nx run artcraft:build
|
|
if ($LASTEXITCODE -ne 0) {
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
echo "Checking build output..."
|
|
dir apps/artcraft/dist/ | Select-Object -First 10
|
|
|
|
# Update Tauri config to skip the build (since we already built)
|
|
cd ${{ github.workspace }}/crates/desktop/artcraft
|
|
Copy-Item tauri.conf.json tauri.conf.json.bak
|
|
|
|
# Set beforeBuildCommand to empty using PowerShell
|
|
$config = Get-Content tauri.conf.json | ConvertFrom-Json
|
|
$config.build.beforeBuildCommand = ""
|
|
$config | ConvertTo-Json -Depth 10 | Set-Content tauri.conf.json
|
|
|
|
- name: build and publish
|
|
uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
# NB(bt): This is needed by wreq. Hopefully it doesn't kill Tauri
|
|
RUSTFLAGS: "-C target-feature=+crt-static"
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# Use the SQLx query cache for SQLite
|
|
SQLX_OFFLINE: true
|
|
with:
|
|
projectPath: ./crates/desktop/artcraft
|
|
tagName: artcraft-v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
|
|
releaseName: "ArtCraft v__VERSION__"
|
|
releaseBody: "Production build of ArtCraft. See the assets below to download and install."
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.args }}
|