From b2ceaff2404af957fd5de684bd7bca4b1216f328 Mon Sep 17 00:00:00 2001 From: jutty Date: Sat, 20 Jun 2026 03:44:01 -0300 Subject: [PATCH 1/2] CI: Build Windows binary in a separate job --- .forgejo/workflows/publish.yaml | 41 ++++++++++++++++++++++++++++--- .forgejo/workflows/setup-tools.sh | 6 ----- 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/publish.yaml b/.forgejo/workflows/publish.yaml index 8a2a961..e21b37c 100644 --- a/.forgejo/workflows/publish.yaml +++ b/.forgejo/workflows/publish.yaml @@ -31,7 +31,6 @@ jobs: rustup component add --toolchain nightly rustfmt clippy rustup target add x86_64-unknown-linux-gnu rustup target add x86_64-unknown-linux-musl - rustup target add x86_64-pc-windows-msvc - name: Setup additional tooling run: .forgejo/workflows/setup-tools.sh @@ -50,9 +49,6 @@ jobs: - name: Build x64 Linux musl release binary run: just release-build-musl - - name: Build x64 Windows MSVC release binary - run: just release-build-msvc - - name: Calculate SHA-256 hashes run: just shasum @@ -78,6 +74,43 @@ jobs: --user jutty:${{ secrets.GJD_REGISTRY_TOKEN }} \ --upload-file target/x86_64-unknown-linux-gnu/release/en $url + publish-windows: + runs-on: docker + timeout-minutes: 20 + container: + image: messense/cargo-xwin + steps: + - name: Install action dependencies + run: apt-get install --no-install-recommends --update -y nodejs curl git + + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-tags: true + + - name: Setup Rust toolchain + run: | + target="x86_64-pc-windows-msvc" + version=$(cat Cargo.toml | grep '^rust-version' | cut -d \" -f 2) + rustup toolchain install --force-non-host "$version-$target" + + - name: Setup additional tooling + run: .forgejo/workflows/setup-tools.sh + + - name: Setup CI user + run: | + useradd -m ci && chown -R ci:ci . + git config --global --add safe.directory "$PWD" + + - name: Run Windows tests + run: just ci test-windows + + - name: Build x64 Windows MSVC release binary + run: just release-build-msvc + + - name: Calculate SHA-256 hashes + run: just shasum + - name: Publish x64 Windows MSVC binary to git.jutty.dev registry if: ${{ inputs.upload }} run: | diff --git a/.forgejo/workflows/setup-tools.sh b/.forgejo/workflows/setup-tools.sh index 55f0707..f4a0886 100755 --- a/.forgejo/workflows/setup-tools.sh +++ b/.forgejo/workflows/setup-tools.sh @@ -15,8 +15,6 @@ TYPOS_VERSION="1.47.2" TYPOS_SHA256SUM="7aef58932fc123b4cf4b40d86468e89a3297d80169051d7cfd13a235e05fc426" CARGO_DENY_VERSION="0.19.8" CARGO_DENY_SHA256SUM="70e769ae3872e34d45132b17040859175e11401dc12dddb0303e0b8c7d088f3f" -CARGO_XWIN_VERSION="0.23.0" -CARGO_XWIN_SHA256SUM="74a216f64f10ea81c909f02d6b1a84cd0fda8de4c87ee52fe63ba76ab2392b75" TRIPLE="x86_64-unknown-linux-gnu" TRIPLE_MUSL="x86_64-unknown-linux-musl" @@ -75,7 +73,3 @@ fetch crate-ci/typos "v$TYPOS_VERSION" \ fetch EmbarkStudios/cargo-deny "$CARGO_DENY_VERSION" \ cargo-deny-$CARGO_DENY_VERSION-$TRIPLE_MUSL.tar.gz \ "$CARGO_DENY_SHA256SUM" cargo-deny - -fetch rust-cross/cargo-xwin "v$CARGO_XWIN_VERSION" \ - cargo-xwin-v$CARGO_XWIN_VERSION.$TRIPLE_MUSL.tar.gz \ - "$CARGO_XWIN_SHA256SUM" cargo-xwin From 29846ec5ae38b38f903f80e916d6badbb49319ef Mon Sep 17 00:00:00 2001 From: jutty Date: Sat, 20 Jun 2026 10:57:24 -0300 Subject: [PATCH 2/2] CI: Add toggles to publish by platform --- .forgejo/workflows/publish.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.forgejo/workflows/publish.yaml b/.forgejo/workflows/publish.yaml index e21b37c..bb13ce4 100644 --- a/.forgejo/workflows/publish.yaml +++ b/.forgejo/workflows/publish.yaml @@ -9,10 +9,21 @@ on: type: boolean required: false default: true + linux: + description: 'Build Linux binaries' + type: boolean + required: false + default: true + windows: + description: 'Build Windows binary' + type: boolean + required: false + default: true jobs: publish: runs-on: docker + if: ${{ inputs.linux }} timeout-minutes: 20 container: image: rust:slim @@ -76,6 +87,7 @@ jobs: publish-windows: runs-on: docker + if: ${{ inputs.windows }} timeout-minutes: 20 container: image: messense/cargo-xwin