From a485c2074faab2ac8aff8412bab7fcd630cd4573 Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 10:49:26 +0900 Subject: [PATCH 1/6] Add Windows build and test workflow --- .github/workflows/windows-build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/windows-build.yml diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 0000000..19f762f --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,29 @@ +name: Build and Test on Windows + +on: + push: + branches: + - add-Windows-build-action + pull_request: + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Check out repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run build script + run: python build.py + + - name: Run tests + run: python -m unittest discover \ No newline at end of file From b3078b1dfe90c022b9c25fd8749d9385bb70f2e8 Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 10:52:36 +0900 Subject: [PATCH 2/6] Update workflow for Rust project on Windows --- .github/workflows/windows-build.yml | 32 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 19f762f..090d6fb 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -1,4 +1,4 @@ -name: Build and Test on Windows +name: Build and Test on Windows (Rust) on: push: @@ -14,16 +14,30 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up Rust + uses: actions/setup-rust@v2 with: - python-version: 3.x + profile: minimal + toolchain: stable - - name: Install dependencies - run: pip install -r requirements.txt + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache cargo index + uses: actions/cache@v3 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-index- - - name: Run build script - run: python build.py + - name: Build the project + run: cargo build --release - name: Run tests - run: python -m unittest discover \ No newline at end of file + run: cargo test --release \ No newline at end of file From c8d6e752e84392d75413fd569c49623c0d89eadd Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 19:45:40 +0900 Subject: [PATCH 3/6] Fix setup-rust action to use actions-rs/toolchain --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 090d6fb..fe7c902 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -14,8 +14,8 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - - name: Set up Rust - uses: actions/setup-rust@v2 + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable From c4dbb9f6123cbe68298cfbeeaaec66b409abfd68 Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 20:00:17 +0900 Subject: [PATCH 4/6] Use rustup for Rust installation to replace deprecated set-output --- .github/workflows/windows-build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index fe7c902..0f6c843 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -14,11 +14,12 @@ jobs: - name: Check out repository uses: actions/checkout@v3 - - name: Set up Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + - name: Install Rust toolchain + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + source $HOME/.cargo/env + rustup install stable + rustup default stable - name: Cache cargo registry uses: actions/cache@v3 From 6c5d9bc271674fb846962a2b4b811650cdadd362 Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 20:01:48 +0900 Subject: [PATCH 5/6] Add workflow to build, package, and create prerelease with artifacts --- .github/workflows/windows-build.yml | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 0f6c843..0878da3 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -1,4 +1,4 @@ -name: Build and Test on Windows (Rust) +name: Build, Package, and Release (Rust) on: push: @@ -7,7 +7,7 @@ on: pull_request: jobs: - build: + build-and-release: runs-on: windows-latest steps: @@ -21,24 +21,32 @@ jobs: rustup install stable rustup default stable - - name: Cache cargo registry - uses: actions/cache@v3 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-registry- - - - name: Cache cargo index - uses: actions/cache@v3 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-index- - - name: Build the project run: cargo build --release - - name: Run tests - run: cargo test --release \ No newline at end of file + - name: Package build artifacts + run: | + mkdir -p release + cp target/release/* release/ + powershell Compress-Archive -Path release/* -DestinationPath release/artifacts.zip + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: windows-build-${{ github.run_id }} + release_name: "Windows Build #${{ github.run_number }}" + draft: false + prerelease: true + + - name: Upload Release Artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: release/artifacts.zip + asset_name: artifacts.zip + asset_content_type: application/zip \ No newline at end of file From bf1ff79b2c70f72d94266c70d319f1db11fd457c Mon Sep 17 00:00:00 2001 From: Atsushi Funakoshi <31555185+funap@users.noreply.github.com> Date: Wed, 20 May 2026 20:04:25 +0900 Subject: [PATCH 6/6] Fix Windows-specific shell issues and adapt to standard Rust workflows --- .github/workflows/windows-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 0878da3..9686f26 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -17,7 +17,7 @@ jobs: - name: Install Rust toolchain run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source $HOME/.cargo/env + $env:Path += ";$HOME\.cargo\bin" rustup install stable rustup default stable @@ -26,9 +26,9 @@ jobs: - name: Package build artifacts run: | - mkdir -p release - cp target/release/* release/ - powershell Compress-Archive -Path release/* -DestinationPath release/artifacts.zip + mkdir release + Copy-Item target\release\* release\ + Compress-Archive -Path release\* -DestinationPath release\artifacts.zip - name: Create Release id: create_release