1818 type : string
1919 required : false
2020 default : " "
21+ windows_variant :
22+ description : " Windows artifact variant to build"
23+ required : false
24+ default : " standard"
25+ type : string
2126
2227name : " Reusable workflow to build CLI"
2328
@@ -64,23 +69,24 @@ jobs:
6469
6570 steps :
6671 - name : Checkout code
72+ if : ${{ inputs.windows_variant == 'standard' || matrix.os == 'windows' }}
6773 uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6874 with :
6975 ref : ${{ inputs.ref }}
7076
7177 - name : Update version in Cargo.toml
72- if : ${{ inputs.version != '' }}
78+ if : ${{ inputs.version != '' && (inputs.windows_variant == 'standard' || matrix.os == 'windows') }}
7379 shell : bash
7480 run : |
7581 sed -i.bak 's/^version = ".*"/version = "'${{ inputs.version }}'"/' Cargo.toml
7682 rm -f Cargo.toml.bak
7783
7884 - name : Install cross
79- if : matrix.use-cross
85+ if : ${{ matrix.use-cross && inputs.windows_variant == 'standard' }}
8086 run : source ./bin/activate-hermit && cargo install cross --git https://github.com/cross-rs/cross
8187
8288 - name : Cache Cargo artifacts (Linux/macOS)
83- if : matrix.use-cross
89+ if : ${{ matrix.use-cross && inputs.windows_variant == 'standard' }}
8490 uses : Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
8591 with :
8692 key : ${{ matrix.architecture }}-${{ matrix.target-suffix }}-macos-deployment-target-12
@@ -89,10 +95,10 @@ jobs:
8995 if : matrix.os == 'windows'
9096 uses : Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
9197 with :
92- key : windows-msvc-cli
98+ key : windows-msvc-cli-${{ inputs.windows_variant }}
9399
94100 - name : Build CLI (Linux/macOS)
95- if : matrix.use-cross
101+ if : ${{ matrix.use-cross && inputs.windows_variant == 'standard' }}
96102 env :
97103 CROSS_NO_WARNINGS : 0
98104 RUST_LOG : debug
@@ -123,7 +129,11 @@ jobs:
123129 shell : bash
124130 run : |
125131 echo "🚀 Building Windows CLI executable..."
126- cargo build --release --target x86_64-pc-windows-msvc -p goose-cli
132+ if [ "${{ inputs.windows_variant }}" = "cuda" ]; then
133+ cargo build --release --target x86_64-pc-windows-msvc -p goose-cli --features cuda
134+ else
135+ cargo build --release --target x86_64-pc-windows-msvc -p goose-cli
136+ fi
127137
128138 if [ ! -f "./target/x86_64-pc-windows-msvc/release/goose.exe" ]; then
129139 echo "❌ Windows CLI binary not found."
@@ -135,7 +145,7 @@ jobs:
135145 ls -la ./target/x86_64-pc-windows-msvc/release/goose.exe
136146
137147 - name : Package CLI (Linux/macOS)
138- if : matrix.use-cross
148+ if : ${{ matrix.use-cross && inputs.windows_variant == 'standard' }}
139149 run : |
140150 source ./bin/activate-hermit
141151 export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
@@ -157,21 +167,25 @@ jobs:
157167 shell : bash
158168 run : |
159169 export TARGET="${{ matrix.architecture }}-${{ matrix.target-suffix }}"
170+ export VARIANT_SUFFIX=""
171+ if [ "${{ inputs.windows_variant }}" = "cuda" ]; then
172+ VARIANT_SUFFIX="-cuda"
173+ fi
160174
161175 mkdir -p "target/${TARGET}/release/goose-package"
162176
163177 cp "target/${TARGET}/release/goose.exe" "target/${TARGET}/release/goose-package/"
164178
165179 cd "target/${TARGET}/release"
166- 7z a -tzip "goose-${TARGET}.zip" goose-package/
167- echo "ARTIFACT_ZIP=target/${TARGET}/release/goose-${TARGET}.zip" >> $GITHUB_ENV
180+ 7z a -tzip "goose-${TARGET}${VARIANT_SUFFIX} .zip" goose-package/
181+ echo "ARTIFACT_ZIP=target/${TARGET}/release/goose-${TARGET}${VARIANT_SUFFIX} .zip" >> $GITHUB_ENV
168182
169183 - name : Upload CLI artifact
184+ if : ${{ inputs.windows_variant == 'standard' || matrix.os == 'windows' }}
170185 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
171186 with :
172- name : goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}
187+ name : goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}${{ inputs.windows_variant == 'cuda' && '-cuda' || '' }}
173188 path : |
174189 ${{ env.ARTIFACT_BZ2 }}
175190 ${{ env.ARTIFACT_GZ }}
176191 ${{ env.ARTIFACT_ZIP }}
177-
0 commit comments