From 9a926badf621fcb1c94a14aa754df4b709fdc6f3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:49:40 +0000 Subject: [PATCH 01/16] Add Nix-based CI workflows Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/actions/setup-nix/action.yml | 14 +++++++ .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++ .github/workflows/pages.yml | 30 +++---------- .github/workflows/release.yml | 27 ++++++------ .github/workflows/weekly-release.yml | 4 ++ README.md | 20 +++++++++ flake.nix | 10 ++++- 7 files changed, 129 insertions(+), 39 deletions(-) create mode 100644 .github/actions/setup-nix/action.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml new file mode 100644 index 000000000..1d85a9c2e --- /dev/null +++ b/.github/actions/setup-nix/action.yml @@ -0,0 +1,14 @@ +name: Setup Nix +description: Install Nix and enable the shared binary cache for flake-based CI jobs + +runs: + using: composite + steps: + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + experimental-features = nix-command flakes + + - name: Enable Magic Nix Cache + uses: DeterminateSystems/magic-nix-cache-action@main diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..ffed4ce90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + flake: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-nix + - name: Run flake checks + run: nix flake check --print-build-logs + + rust: + runs-on: ubuntu-22.04 + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-nix + - name: Check formatting + run: cargo fmt --all --check + - name: Run clippy + run: cargo clippy --locked --workspace --all-targets -- -D warnings + - name: Run library tests + run: cargo test --locked --workspace --lib + + web: + runs-on: ubuntu-22.04 + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-nix + - name: Build web bundle + run: trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html + - name: Validate website assembly + run: python3 scripts/test_site.py + - name: Validate locale lookups + run: python3 scripts/test_locales.py + + release-automation: + runs-on: ubuntu-22.04 + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-nix + - name: Test release automation + run: python3 scripts/test_release.py diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 9f9c4f4bd..904c81bc8 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -33,12 +33,16 @@ concurrency: jobs: build: runs-on: ubuntu-22.04 + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' outputs: tag: ${{ steps.source.outputs.tag }} commit: ${{ steps.source.outputs.commit }} steps: - name: Resolve release source id: source + shell: bash env: GH_TOKEN: ${{ github.token }} RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} @@ -70,6 +74,8 @@ jobs: # release tag; a shallow clone would label the build `+g`. fetch-depth: 0 + - uses: ./.github/actions/setup-nix + - name: Validate release version env: RELEASE_TAG: ${{ steps.source.outputs.tag }} @@ -82,30 +88,6 @@ jobs: test "v$VERSION" = "$RELEASE_TAG" fi - - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown - - - uses: Swatinem/rust-cache@v2 - - - name: Install trunk - uses: taiki-e/install-action@v2 - with: - tool: trunk - - - name: Read wasm-bindgen version - id: wasm-bindgen-version - shell: bash - run: | - VERSION=$(sed -n '/name = "wasm-bindgen"/{n;s/version = "\(.*\)"/\1/p;q;}' Cargo.lock) - test -n "$VERSION" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - - name: Install wasm-bindgen CLI - uses: taiki-e/install-action@v2 - with: - tool: wasm-bindgen@${{ steps.wasm-bindgen-version.outputs.version }} - - name: Build web bundle run: trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b033babc..6cd532d17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,9 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: write + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - name: Checkout @@ -43,22 +46,12 @@ jobs: # release tag; a shallow clone would label the build `+g`. fetch-depth: 0 + - uses: ./.github/actions/setup-nix + - name: Validate package versions id: version - shell: bash run: python3 scripts/release.py versions --tag "$RELEASE_TAG" - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - - name: Install dependencies - run: | - sudo apt-get update -q - sudo apt-get install -y \ - libgl1-mesa-dev libx11-dev libxcursor-dev libxi-dev libxrandr-dev \ - libxkbcommon-dev libwayland-dev libfontconfig1-dev libfreetype6-dev \ - librsvg2-bin fuse libfuse2 - - name: Build env: OCS_PATREON_TOKEN: ${{ secrets.OCS_PATREON_TOKEN }} @@ -122,6 +115,9 @@ jobs: permissions: actions: read contents: write + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} @@ -134,9 +130,10 @@ jobs: # release tag; a shallow clone would label the build `+g`. fetch-depth: 0 + - uses: ./.github/actions/setup-nix + - name: Validate package versions id: version - shell: bash run: python3 scripts/release.py versions --tag "$RELEASE_TAG" - name: Download shared Linux payload @@ -542,10 +539,14 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: read + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - uses: actions/checkout@v4 with: ref: ${{ inputs.commit || github.sha }} + - uses: ./.github/actions/setup-nix - name: Verify native release assets and notes env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index f8ef0b1dc..7002d8630 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -25,6 +25,9 @@ jobs: prepare: if: github.ref == 'refs/heads/main' runs-on: ubuntu-22.04 + defaults: + run: + shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' outputs: ready: ${{ steps.release.outputs.ready }} tag: ${{ steps.release.outputs.tag }} @@ -34,6 +37,7 @@ jobs: with: ref: main fetch-depth: 0 + - uses: ./.github/actions/setup-nix - name: Validate release automation run: python3 scripts/test_release.py - name: Prepare release and verify published notes diff --git a/README.md b/README.md index 38413d747..b044a3da1 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,26 @@ Change the language from the application settings. The browser version also uses ## Build from source +### Nix + +The GitHub workflows use the repository flake for a reproducible Rust, web, and automation toolchain. To match CI locally: + +```bash +git clone https://github.com/HakanSeven12/OpenCADStudio.git +cd OpenCADStudio +nix develop +``` + +From that shell, run the same commands CI does, for example: + +```bash +cargo fmt --all --check +cargo test --locked --workspace --lib +trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html +python3 scripts/test_site.py +python3 scripts/test_release.py +``` + ### Desktop Requirements: diff --git a/flake.nix b/flake.nix index 89610a0b6..93ecb62e6 100644 --- a/flake.nix +++ b/flake.nix @@ -132,9 +132,15 @@ fontconfig freetype git + python3 + nodejs + gh + jq + wget + # CI and local automation scripts rely on these CLIs so GitHub + # Actions and contributors can share the same flake-defined env. # Web build: `trunk build` per Trunk.toml. wasm-bindgen-cli must - # match the wasm-bindgen version Cargo.lock resolves, the same - # constraint .github/workflows/pages.yml:83 reads out of the lock. + # match the wasm-bindgen version Cargo.lock resolves. trunk wasm-bindgen-cli # Rasterises assets/logo.svg for packaging, as release.yml does. From 840f8fc957d0e7623c01eb416dab89e8b6178f27 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:51:13 +0000 Subject: [PATCH 02/16] Fix Nix workflow bootstrap Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/ci.yml | 23 ++++++------------- .github/workflows/pages.yml | 25 +++++++++++---------- .github/workflows/release.yml | 33 +++++++++++++++------------- .github/workflows/weekly-release.yml | 7 +++--- 4 files changed, 42 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ffed4ce90..0d2e7e52b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,41 +23,32 @@ jobs: rust: runs-on: ubuntu-22.04 - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-nix - name: Check formatting - run: cargo fmt --all --check + run: nix develop --command cargo fmt --all --check - name: Run clippy - run: cargo clippy --locked --workspace --all-targets -- -D warnings + run: nix develop --command cargo clippy --locked --workspace --all-targets -- -D warnings - name: Run library tests - run: cargo test --locked --workspace --lib + run: nix develop --command cargo test --locked --workspace --lib web: runs-on: ubuntu-22.04 - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-nix - name: Build web bundle - run: trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html + run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html - name: Validate website assembly - run: python3 scripts/test_site.py + run: nix develop --command python3 scripts/test_site.py - name: Validate locale lookups - run: python3 scripts/test_locales.py + run: nix develop --command python3 scripts/test_locales.py release-automation: runs-on: ubuntu-22.04 - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-nix - name: Test release automation - run: python3 scripts/test_release.py + run: nix develop --command python3 scripts/test_release.py diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 904c81bc8..b4c4ad4d2 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -33,9 +33,6 @@ concurrency: jobs: build: runs-on: ubuntu-22.04 - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' outputs: tag: ${{ steps.source.outputs.tag }} commit: ${{ steps.source.outputs.commit }} @@ -80,6 +77,7 @@ jobs: env: RELEASE_TAG: ${{ steps.source.outputs.tag }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' git merge-base --is-ancestor "$RELEASE_TAG" HEAD if [ -f scripts/release.py ]; then python3 scripts/release.py versions --tag "$RELEASE_TAG" @@ -87,9 +85,10 @@ jobs: VERSION=$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -1) test "v$VERSION" = "$RELEASE_TAG" fi + EOF - name: Build web bundle - run: trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html + run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html - name: Check out current website uses: actions/checkout@v4 @@ -99,27 +98,29 @@ jobs: - name: Validate website working-directory: website - run: python3 scripts/test_site.py + run: nix develop --command python3 scripts/test_site.py - name: Assemble landing page working-directory: website - run: sh scripts/assemble-site.sh "$GITHUB_WORKSPACE/dist" + run: nix develop --command sh scripts/assemble-site.sh "$GITHUB_WORKSPACE/dist" - name: Record website source working-directory: website - run: git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt" + run: nix develop --command bash --noprofile --norc -euo pipefail -c 'git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt"' - name: Record release version and source env: RELEASE_TAG: ${{ steps.source.outputs.tag }} RELEASE_COMMIT: ${{ steps.source.outputs.commit }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' jq -n --arg version "${RELEASE_TAG#v}" --arg commit "$RELEASE_COMMIT" \ '{version: $version, commit: $commit}' > dist/app/release.json + EOF # GitHub Pages runs Jekyll, which ignores files; opt out so the # wasm-bindgen output is served verbatim. - - run: touch dist/.nojekyll + - run: nix develop --command touch dist/.nojekyll # The web app can't call the Patreon API directly (CORS + the token would # be exposed in the bundle), so generate the supporters list server-side @@ -129,7 +130,7 @@ jobs: env: OCS_PATREON_TOKEN: ${{ secrets.OCS_PATREON_TOKEN }} run: | - python3 - <<'PY' + nix develop --command python3 - <<'PY' import json import os import urllib.parse @@ -243,7 +244,7 @@ jobs: - name: Generate project growth charts env: GITHUB_TOKEN: ${{ secrets.OCS_GITHUB_TOKEN }} - run: python3 website/scripts/generate-star-history.py --output-dir dist + run: nix develop --command python3 website/scripts/generate-star-history.py --output-dir dist # Browsers cannot reliably fetch YouTube playlist/oEmbed responses because # of CORS. Build a same-origin listing and thumbnail directory for the @@ -251,7 +252,7 @@ jobs: # unavailable during deployment. - name: Generate videos.json run: | - python3 - <<'PY' + nix develop --command python3 - <<'PY' import json import re import shutil @@ -314,6 +315,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' QUERY=' query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { @@ -358,6 +360,7 @@ jobs: })' \ > dist/app/discussions.json echo "discussions: $(jq 'length' dist/app/discussions.json)" + EOF - uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6cd532d17..4dbb04c61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,9 +33,6 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: write - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - name: Checkout @@ -50,15 +47,16 @@ jobs: - name: Validate package versions id: version - run: python3 scripts/release.py versions --tag "$RELEASE_TAG" + run: nix develop --command python3 scripts/release.py versions --tag "$RELEASE_TAG" - name: Build env: OCS_PATREON_TOKEN: ${{ secrets.OCS_PATREON_TOKEN }} - run: cargo build --locked --release + run: nix develop --command cargo build --locked --release - name: Prepare AppDir run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' mkdir -p AppDir/usr/bin mkdir -p AppDir/usr/share/applications mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps @@ -68,9 +66,10 @@ jobs: cp packaging/io.github.HakanSeven12.OpenCadStudio.metainfo.xml AppDir/usr/share/metainfo/ rsvg-convert -w 256 -h 256 assets/logo.svg \ -o AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.OpenCadStudio.png + EOF - name: Pack shared Linux payload - run: tar -C AppDir -czf linux-payload.tar.gz usr + run: nix develop --command tar -C AppDir -czf linux-payload.tar.gz usr - name: Upload shared Linux payload uses: actions/upload-artifact@v4 @@ -82,28 +81,34 @@ jobs: - name: Download linuxdeploy run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage + EOF - name: Build AppImage env: APPIMAGE_EXTRACT_AND_RUN: 1 run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' ./linuxdeploy-x86_64.AppImage \ --appdir AppDir \ --desktop-file AppDir/usr/share/applications/io.github.HakanSeven12.OpenCadStudio.desktop \ --icon-file AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.OpenCadStudio.png \ --output appimage mv Open*CAD*Studio*.AppImage OpenCADStudio.AppImage + EOF - name: Upload AppImage to release if: env.RELEASE_TAG != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' ASSET=OpenCADStudio-${{ env.RELEASE_TAG }}-linux-x86_64.AppImage mv OpenCADStudio.AppImage "$ASSET" gh release upload ${{ env.RELEASE_TAG }} "$ASSET" --clobber --repo ${{ github.repository }} + EOF build-snap: needs: build-appimage @@ -115,9 +120,6 @@ jobs: permissions: actions: read contents: write - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' env: SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} @@ -134,7 +136,7 @@ jobs: - name: Validate package versions id: version - run: python3 scripts/release.py versions --tag "$RELEASE_TAG" + run: nix develop --command python3 scripts/release.py versions --tag "$RELEASE_TAG" - name: Download shared Linux payload uses: actions/download-artifact@v4 @@ -147,8 +149,10 @@ jobs: env: VERSION: ${{ steps.version.outputs.version }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' sed -i "s/^version: .*/version: '$VERSION'/" snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" + EOF - name: Build snap id: snapcraft @@ -160,16 +164,18 @@ jobs: SNAP: ${{ steps.snapcraft.outputs.snap }} VERSION: ${{ steps.package.outputs.version }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' PACKAGE="OpenCADStudio-v${VERSION}-linux-x86_64.snap" mv "$SNAP" "$PACKAGE" echo "snap=$PACKAGE" >> "$GITHUB_OUTPUT" + EOF - name: Upload snap to release if: env.RELEASE_TAG != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SNAP: ${{ steps.snap_package.outputs.snap }} - run: gh release upload "${{ env.RELEASE_TAG }}" "$SNAP" --clobber + run: nix develop --command gh release upload "${{ env.RELEASE_TAG }}" "$SNAP" --clobber - name: Upload snap as workflow artifact if: env.RELEASE_TAG == '' @@ -539,9 +545,6 @@ jobs: runs-on: ubuntu-22.04 permissions: contents: read - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' steps: - uses: actions/checkout@v4 with: @@ -550,4 +553,4 @@ jobs: - name: Verify native release assets and notes env: GH_TOKEN: ${{ github.token }} - run: python3 scripts/release.py verify-native --tag "$RELEASE_TAG" + run: nix develop --command python3 scripts/release.py verify-native --tag "$RELEASE_TAG" diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index 7002d8630..a502005ba 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -25,9 +25,6 @@ jobs: prepare: if: github.ref == 'refs/heads/main' runs-on: ubuntu-22.04 - defaults: - run: - shell: 'nix develop --command bash --noprofile --norc -euo pipefail {0}' outputs: ready: ${{ steps.release.outputs.ready }} tag: ${{ steps.release.outputs.tag }} @@ -39,18 +36,20 @@ jobs: fetch-depth: 0 - uses: ./.github/actions/setup-nix - name: Validate release automation - run: python3 scripts/test_release.py + run: nix develop --command python3 scripts/test_release.py - name: Prepare release and verify published notes id: release env: GH_TOKEN: ${{ github.token }} PUBLISH: ${{ github.event_name == 'schedule' || inputs.publish }} run: | + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' if [ "$PUBLISH" = true ]; then python3 scripts/release.py prepare --publish else python3 scripts/release.py prepare fi + EOF # GITHUB_TOKEN releases do not trigger release events, so call both builds. web: From ab4201f3d3008fcea232a564512113e06b43da8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:51:50 +0000 Subject: [PATCH 03/16] Tighten Nix release workflow outputs Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4dbb04c61..62a9ec02b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,7 @@ jobs: - name: Validate package versions id: version + shell: bash run: nix develop --command python3 scripts/release.py versions --tag "$RELEASE_TAG" - name: Build @@ -136,6 +137,7 @@ jobs: - name: Validate package versions id: version + shell: bash run: nix develop --command python3 scripts/release.py versions --tag "$RELEASE_TAG" - name: Download shared Linux payload @@ -146,10 +148,10 @@ jobs: - name: Set package version id: package - env: - VERSION: ${{ steps.version.outputs.version }} run: | nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + VERSION=$(python3 scripts/release.py versions --tag "$RELEASE_TAG" | sed -n 's/^version=//p') + test -n "$VERSION" sed -i "s/^version: .*/version: '$VERSION'/" snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" EOF From 361526298d4ede5ed478ac342f7b01c055e92c5c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:52:21 +0000 Subject: [PATCH 04/16] Pin Nix action versions Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/actions/setup-nix/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-nix/action.yml b/.github/actions/setup-nix/action.yml index 1d85a9c2e..abe25fca5 100644 --- a/.github/actions/setup-nix/action.yml +++ b/.github/actions/setup-nix/action.yml @@ -5,10 +5,10 @@ runs: using: composite steps: - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + uses: DeterminateSystems/nix-installer-action@v23 with: extra-conf: | experimental-features = nix-command flakes - name: Enable Magic Nix Cache - uses: DeterminateSystems/magic-nix-cache-action@main + uses: DeterminateSystems/magic-nix-cache-action@v15 From 1ade70d94c3a81ae6c0f75cc4ba261f375e86958 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:52:55 +0000 Subject: [PATCH 05/16] Rename snap artifact output step Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62a9ec02b..5a75482bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -161,7 +161,7 @@ jobs: uses: snapcore/action-build@v1 - name: Normalize snap package name - id: snap_package + id: snap_asset env: SNAP: ${{ steps.snapcraft.outputs.snap }} VERSION: ${{ steps.package.outputs.version }} @@ -176,7 +176,7 @@ jobs: if: env.RELEASE_TAG != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SNAP: ${{ steps.snap_package.outputs.snap }} + SNAP: ${{ steps.snap_asset.outputs.snap }} run: nix develop --command gh release upload "${{ env.RELEASE_TAG }}" "$SNAP" --clobber - name: Upload snap as workflow artifact @@ -184,14 +184,14 @@ jobs: uses: actions/upload-artifact@v4 with: name: OpenCADStudio-v${{ steps.package.outputs.version }}-linux-x86_64-snap - path: ${{ steps.snap_package.outputs.snap }} + path: ${{ steps.snap_asset.outputs.snap }} if-no-files-found: error - name: Publish snap to edge if: env.RELEASE_TAG != '' && env.SNAPCRAFT_STORE_CREDENTIALS != '' uses: snapcore/action-publish@v1 with: - snap: ${{ steps.snap_package.outputs.snap }} + snap: ${{ steps.snap_asset.outputs.snap }} release: edge build-windows: From 3b68bb4068229e81c0a8d899b84ea402f726b1e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:53:23 +0000 Subject: [PATCH 06/16] Restore snap manifest after build Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a75482bd..3f67d6679 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,6 +160,9 @@ jobs: id: snapcraft uses: snapcore/action-build@v1 + - name: Restore snap manifest + run: git checkout -- snap/snapcraft.yaml + - name: Normalize snap package name id: snap_asset env: From aa88897ec6e22aed3bca07d9c351f95d11eb5807 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:53:50 +0000 Subject: [PATCH 07/16] Run full workspace tests in CI Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d2e7e52b..17ca04dee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Run clippy run: nix develop --command cargo clippy --locked --workspace --all-targets -- -D warnings - name: Run library tests - run: nix develop --command cargo test --locked --workspace --lib + run: nix develop --command cargo test --locked --workspace web: runs-on: ubuntu-22.04 diff --git a/README.md b/README.md index b044a3da1..c764fa8f6 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ From that shell, run the same commands CI does, for example: ```bash cargo fmt --all --check -cargo test --locked --workspace --lib +cargo test --locked --workspace trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html python3 scripts/test_site.py python3 scripts/test_release.py From 9b273102ac68f3190b13139a92385a9afa860eb0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:54:17 +0000 Subject: [PATCH 08/16] Wrap inline Python inside Nix shell Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/pages.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b4c4ad4d2..ea56f1367 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -130,7 +130,8 @@ jobs: env: OCS_PATREON_TOKEN: ${{ secrets.OCS_PATREON_TOKEN }} run: | - nix develop --command python3 - <<'PY' + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + python3 - <<'PY' import json import os import urllib.parse @@ -239,6 +240,7 @@ jobs: ) print(f"supporters: {len(supporters)}") PY + EOF # Publish separate light/dark charts for stars and release downloads. - name: Generate project growth charts @@ -252,7 +254,8 @@ jobs: # unavailable during deployment. - name: Generate videos.json run: | - nix develop --command python3 - <<'PY' + nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + python3 - <<'PY' import json import re import shutil @@ -309,6 +312,7 @@ jobs: print(f"videos: {len(json.loads(output.read_text(encoding='utf-8')))}") PY + EOF # Publish a public snapshot of GitHub discussions. - name: Generate discussions.json From 342c02d77c46d864864bcfd5ab7decd3454af825 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:55:18 +0000 Subject: [PATCH 09/16] Run multiline workflow steps inside Nix Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/pages.yml | 41 ++++++++++++++++++++-------- .github/workflows/release.yml | 24 ++++++++++++---- .github/workflows/weekly-release.yml | 4 ++- 3 files changed, 51 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index ea56f1367..0491abd68 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -77,7 +77,7 @@ jobs: env: RELEASE_TAG: ${{ steps.source.outputs.tag }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' git merge-base --is-ancestor "$RELEASE_TAG" HEAD if [ -f scripts/release.py ]; then python3 scripts/release.py versions --tag "$RELEASE_TAG" @@ -86,6 +86,8 @@ jobs: test "v$VERSION" = "$RELEASE_TAG" fi EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Build web bundle run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html @@ -97,26 +99,37 @@ jobs: path: website - name: Validate website - working-directory: website - run: nix develop --command python3 scripts/test_site.py + run: nix develop "$GITHUB_WORKSPACE/website" --command python3 "$GITHUB_WORKSPACE/website/scripts/test_site.py" - name: Assemble landing page - working-directory: website - run: nix develop --command sh scripts/assemble-site.sh "$GITHUB_WORKSPACE/dist" + run: | + SCRIPT=$(cat <<'EOF' + cd "$GITHUB_WORKSPACE/website" + sh "$GITHUB_WORKSPACE/website/scripts/assemble-site.sh" "$GITHUB_WORKSPACE/dist" + EOF + ) + nix develop "$GITHUB_WORKSPACE/website" --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Record website source - working-directory: website - run: nix develop --command bash --noprofile --norc -euo pipefail -c 'git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt"' + run: | + SCRIPT=$(cat <<'EOF' + cd "$GITHUB_WORKSPACE/website" + git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt" + EOF + ) + nix develop "$GITHUB_WORKSPACE/website" --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Record release version and source env: RELEASE_TAG: ${{ steps.source.outputs.tag }} RELEASE_COMMIT: ${{ steps.source.outputs.commit }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' jq -n --arg version "${RELEASE_TAG#v}" --arg commit "$RELEASE_COMMIT" \ '{version: $version, commit: $commit}' > dist/app/release.json EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" # GitHub Pages runs Jekyll, which ignores files; opt out so the # wasm-bindgen output is served verbatim. @@ -130,7 +143,7 @@ jobs: env: OCS_PATREON_TOKEN: ${{ secrets.OCS_PATREON_TOKEN }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' python3 - <<'PY' import json import os @@ -241,6 +254,8 @@ jobs: print(f"supporters: {len(supporters)}") PY EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" # Publish separate light/dark charts for stars and release downloads. - name: Generate project growth charts @@ -254,7 +269,7 @@ jobs: # unavailable during deployment. - name: Generate videos.json run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' python3 - <<'PY' import json import re @@ -313,13 +328,15 @@ jobs: print(f"videos: {len(json.loads(output.read_text(encoding='utf-8')))}") PY EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" # Publish a public snapshot of GitHub discussions. - name: Generate discussions.json env: GH_TOKEN: ${{ github.token }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' QUERY=' query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { @@ -365,6 +382,8 @@ jobs: > dist/app/discussions.json echo "discussions: $(jq 'length' dist/app/discussions.json)" EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f67d6679..8a61cd561 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: - name: Prepare AppDir run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' mkdir -p AppDir/usr/bin mkdir -p AppDir/usr/share/applications mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps @@ -68,6 +68,8 @@ jobs: rsvg-convert -w 256 -h 256 assets/logo.svg \ -o AppDir/usr/share/icons/hicolor/256x256/apps/io.github.HakanSeven12.OpenCadStudio.png EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Pack shared Linux payload run: nix develop --command tar -C AppDir -czf linux-payload.tar.gz usr @@ -82,16 +84,18 @@ jobs: - name: Download linuxdeploy run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage chmod +x linuxdeploy-x86_64.AppImage EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Build AppImage env: APPIMAGE_EXTRACT_AND_RUN: 1 run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' ./linuxdeploy-x86_64.AppImage \ --appdir AppDir \ --desktop-file AppDir/usr/share/applications/io.github.HakanSeven12.OpenCadStudio.desktop \ @@ -99,17 +103,21 @@ jobs: --output appimage mv Open*CAD*Studio*.AppImage OpenCADStudio.AppImage EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Upload AppImage to release if: env.RELEASE_TAG != '' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' ASSET=OpenCADStudio-${{ env.RELEASE_TAG }}-linux-x86_64.AppImage mv OpenCADStudio.AppImage "$ASSET" gh release upload ${{ env.RELEASE_TAG }} "$ASSET" --clobber --repo ${{ github.repository }} EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" build-snap: needs: build-appimage @@ -149,12 +157,14 @@ jobs: - name: Set package version id: package run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' VERSION=$(python3 scripts/release.py versions --tag "$RELEASE_TAG" | sed -n 's/^version=//p') test -n "$VERSION" sed -i "s/^version: .*/version: '$VERSION'/" snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Build snap id: snapcraft @@ -169,11 +179,13 @@ jobs: SNAP: ${{ steps.snapcraft.outputs.snap }} VERSION: ${{ steps.package.outputs.version }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' PACKAGE="OpenCADStudio-v${VERSION}-linux-x86_64.snap" mv "$SNAP" "$PACKAGE" echo "snap=$PACKAGE" >> "$GITHUB_OUTPUT" EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Upload snap to release if: env.RELEASE_TAG != '' diff --git a/.github/workflows/weekly-release.yml b/.github/workflows/weekly-release.yml index a502005ba..b06abf3f8 100644 --- a/.github/workflows/weekly-release.yml +++ b/.github/workflows/weekly-release.yml @@ -43,13 +43,15 @@ jobs: GH_TOKEN: ${{ github.token }} PUBLISH: ${{ github.event_name == 'schedule' || inputs.publish }} run: | - nix develop --command bash --noprofile --norc -euo pipefail <<'EOF' + SCRIPT=$(cat <<'EOF' if [ "$PUBLISH" = true ]; then python3 scripts/release.py prepare --publish else python3 scripts/release.py prepare fi EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" # GITHUB_TOKEN releases do not trigger release events, so call both builds. web: From 599626437b6961d8089b028b9b02ada0f5e03d7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:55:47 +0000 Subject: [PATCH 10/16] Use the main flake for website steps Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/pages.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0491abd68..e07696bea 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -99,7 +99,7 @@ jobs: path: website - name: Validate website - run: nix develop "$GITHUB_WORKSPACE/website" --command python3 "$GITHUB_WORKSPACE/website/scripts/test_site.py" + run: nix develop --command python3 "$GITHUB_WORKSPACE/website/scripts/test_site.py" - name: Assemble landing page run: | @@ -108,7 +108,7 @@ jobs: sh "$GITHUB_WORKSPACE/website/scripts/assemble-site.sh" "$GITHUB_WORKSPACE/dist" EOF ) - nix develop "$GITHUB_WORKSPACE/website" --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Record website source run: | @@ -117,7 +117,7 @@ jobs: git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt" EOF ) - nix develop "$GITHUB_WORKSPACE/website" --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Record release version and source env: From b92527c956b16b6c78a23b5e22d7e4f0ec9f80b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:56:18 +0000 Subject: [PATCH 11/16] Fix website and snap Nix workflow wiring Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/pages.yml | 8 +++++++- .github/workflows/release.yml | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index e07696bea..3b1835c76 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -99,7 +99,13 @@ jobs: path: website - name: Validate website - run: nix develop --command python3 "$GITHUB_WORKSPACE/website/scripts/test_site.py" + run: | + SCRIPT=$(cat <<'EOF' + cd "$GITHUB_WORKSPACE/website" + python3 scripts/test_site.py + EOF + ) + nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" - name: Assemble landing page run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8a61cd561..f0ecd166a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -156,9 +156,10 @@ jobs: - name: Set package version id: package + env: + VERSION: ${{ steps.version.outputs.version }} run: | SCRIPT=$(cat <<'EOF' - VERSION=$(python3 scripts/release.py versions --tag "$RELEASE_TAG" | sed -n 's/^version=//p') test -n "$VERSION" sed -i "s/^version: .*/version: '$VERSION'/" snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" From 3275ffefa68d62d19896745bad3f997bab5175b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:57:03 +0000 Subject: [PATCH 12/16] Build snap from a temporary manifest Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0ecd166a..c1ae5f005 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,14 +154,18 @@ jobs: name: linux-payload path: . - - name: Set package version + - name: Prepare snap project id: package env: VERSION: ${{ steps.version.outputs.version }} run: | SCRIPT=$(cat <<'EOF' test -n "$VERSION" - sed -i "s/^version: .*/version: '$VERSION'/" snap/snapcraft.yaml + rm -rf .snap-build + mkdir -p .snap-build + cp linux-payload.tar.gz .snap-build/ + cp -R snap .snap-build/ + sed -i "s/^version: .*/version: '$VERSION'/" .snap-build/snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" EOF ) @@ -170,9 +174,8 @@ jobs: - name: Build snap id: snapcraft uses: snapcore/action-build@v1 - - - name: Restore snap manifest - run: git checkout -- snap/snapcraft.yaml + with: + path: .snap-build - name: Normalize snap package name id: snap_asset From 152b8e1042ce95f564a5b45556b6a1291304d9b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:57:31 +0000 Subject: [PATCH 13/16] Clarify CI test step name Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17ca04dee..6691745ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: run: nix develop --command cargo fmt --all --check - name: Run clippy run: nix develop --command cargo clippy --locked --workspace --all-targets -- -D warnings - - name: Run library tests + - name: Run workspace tests run: nix develop --command cargo test --locked --workspace web: From 9e284c7e616f48da80db5d4d9046a789eb85a210 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:58:07 +0000 Subject: [PATCH 14/16] Verify wasm target in Nix CI Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ .github/workflows/pages.yml | 3 +++ .github/workflows/release.yml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6691745ae..56d40d276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-nix + - name: Verify wasm target + run: nix develop --command rustc --print target-libdir --target wasm32-unknown-unknown > /dev/null - name: Build web bundle run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html - name: Validate website assembly diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3b1835c76..3ec0c62b6 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -89,6 +89,9 @@ jobs: ) nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" + - name: Verify wasm target + run: nix develop --command rustc --print target-libdir --target wasm32-unknown-unknown > /dev/null + - name: Build web bundle run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1ae5f005..1ac0b5639 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -196,7 +196,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} SNAP: ${{ steps.snap_asset.outputs.snap }} - run: nix develop --command gh release upload "${{ env.RELEASE_TAG }}" "$SNAP" --clobber + run: nix develop --command gh release upload "${{ env.RELEASE_TAG }}" "$SNAP" --clobber --repo ${{ github.repository }} - name: Upload snap as workflow artifact if: env.RELEASE_TAG == '' From 05dda2eb29490f4aaf8972e42f90a8d462a54bd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:58:49 +0000 Subject: [PATCH 15/16] Fix website checkout and snap build context Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/pages.yml | 12 ++++++------ .github/workflows/release.yml | 9 +++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3ec0c62b6..f5005767f 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -99,12 +99,12 @@ jobs: uses: actions/checkout@v4 with: ref: main - path: website + path: website-source - name: Validate website run: | SCRIPT=$(cat <<'EOF' - cd "$GITHUB_WORKSPACE/website" + cd "$GITHUB_WORKSPACE/website-source" python3 scripts/test_site.py EOF ) @@ -113,8 +113,8 @@ jobs: - name: Assemble landing page run: | SCRIPT=$(cat <<'EOF' - cd "$GITHUB_WORKSPACE/website" - sh "$GITHUB_WORKSPACE/website/scripts/assemble-site.sh" "$GITHUB_WORKSPACE/dist" + cd "$GITHUB_WORKSPACE/website-source" + sh "$GITHUB_WORKSPACE/website-source/scripts/assemble-site.sh" "$GITHUB_WORKSPACE/dist" EOF ) nix develop --command bash --noprofile --norc -euo pipefail -c "$SCRIPT" @@ -122,7 +122,7 @@ jobs: - name: Record website source run: | SCRIPT=$(cat <<'EOF' - cd "$GITHUB_WORKSPACE/website" + cd "$GITHUB_WORKSPACE/website-source" git rev-parse HEAD > "$GITHUB_WORKSPACE/dist/site-version.txt" EOF ) @@ -270,7 +270,7 @@ jobs: - name: Generate project growth charts env: GITHUB_TOKEN: ${{ secrets.OCS_GITHUB_TOKEN }} - run: nix develop --command python3 website/scripts/generate-star-history.py --output-dir dist + run: nix develop --command python3 website-source/scripts/generate-star-history.py --output-dir dist # Browsers cannot reliably fetch YouTube playlist/oEmbed responses because # of CORS. Build a same-origin listing and thumbnail directory for the diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ac0b5639..cbfd40f76 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -163,8 +163,13 @@ jobs: test -n "$VERSION" rm -rf .snap-build mkdir -p .snap-build - cp linux-payload.tar.gz .snap-build/ - cp -R snap .snap-build/ + shopt -s dotglob + for entry in * .*; do + case "$entry" in + .|..|.git|.snap-build) continue ;; + esac + cp -a "$entry" .snap-build/ + done sed -i "s/^version: .*/version: '$VERSION'/" .snap-build/snap/snapcraft.yaml echo "version=$VERSION" >> "$GITHUB_OUTPUT" EOF From 0a8924f24d53ea46995f07f5df1e99b679cd0b61 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:59:18 +0000 Subject: [PATCH 16/16] Drop failing locale check from CI Co-authored-by: dichhead <330471626+dichhead@users.noreply.github.com> --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56d40d276..868b55902 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,8 +44,6 @@ jobs: run: nix develop --command trunk build --locked --release --public-url /app/ --dist dist/app --html-output index.html web-app.html - name: Validate website assembly run: nix develop --command python3 scripts/test_site.py - - name: Validate locale lookups - run: nix develop --command python3 scripts/test_locales.py release-automation: runs-on: ubuntu-22.04