5656 runs-on : ${{ matrix.os }}
5757 strategy :
5858 matrix :
59- os : [ubuntu-latest, macos-latest]
59+ os : [ubuntu-latest, macos-latest, windows-latest ]
6060 steps :
6161 - uses : actions/checkout@v4
6262 - name : Install Rust stable
8686 runner : ubuntu-latest
8787 - target : aarch64-unknown-linux-musl
8888 runner : ubuntu-24.04-arm
89+ - target : x86_64-pc-windows-msvc
90+ runner : windows-latest
91+ - target : aarch64-pc-windows-msvc
92+ runner : windows-11-arm
8993 steps :
9094 - uses : actions/checkout@v4
9195 - name : Install Rust stable
@@ -99,15 +103,22 @@ jobs:
99103 - name : Build release binary
100104 run : cargo build --release --target ${{ matrix.target }}
101105 - name : Rename binary
102- run : cp target/${{ matrix.target }}/release/cship cship-${{ matrix.target }}
106+ shell : bash
107+ run : |
108+ EXT=""
109+ if [[ "${{ matrix.target }}" == *windows* ]]; then EXT=".exe"; fi
110+ cp "target/${{ matrix.target }}/release/cship${EXT}" "cship-${{ matrix.target }}${EXT}"
103111 - name : Validate binary
112+ shell : bash
104113 run : |
105- file cship-${{ matrix.target }}
106- test -s cship-${{ matrix.target }} || { echo "ERROR: binary is empty"; exit 1; }
114+ EXT=""
115+ if [[ "${{ matrix.target }}" == *windows* ]]; then EXT=".exe"; fi
116+ if [[ "${{ matrix.target }}" != *windows* ]]; then file "cship-${{ matrix.target }}"; fi
117+ test -s "cship-${{ matrix.target }}${EXT}" || { echo "ERROR: binary is empty"; exit 1; }
107118 - uses : actions/upload-artifact@v4
108119 with :
109120 name : cship-${{ matrix.target }}
110- path : cship-${{ matrix.target }}
121+ path : cship-${{ matrix.target }}*
111122
112123 release :
113124 name : Publish GitHub Release
0 commit comments