diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 976cd236..7cec64b7 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -30,9 +30,7 @@ jobs: uses: actions/checkout@v2 - name: Set MSVC target (windows only) if: matrix.os == 'windows-latest' - run: | - echo "[build]" > .cargo/config - echo "target = "x86_64-pc-windows-msvc" >> .cargo/config + run: bash ./scripts/set-windows-msvc.sh - name: Build example working-directory: examples/${{ matrix.example }} run: cargo build diff --git a/scripts/set-windows-msvc.sh b/scripts/set-windows-msvc.sh new file mode 100644 index 00000000..37d7d7c5 --- /dev/null +++ b/scripts/set-windows-msvc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Create a .cargo directory if it does not exist +mkdir -p .cargo + +# Create a config file with the target set to x86_64-pc-windows-msvc +echo "[build]" > .cargo/config +echo "target = "x86_64-pc-windows-msvc" >> .cargo/config \ No newline at end of file