From 589ebc87a8223b9f2eddb75613893c1aaf7b21b7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 9 Nov 2023 16:07:46 +0000 Subject: [PATCH] ci: add Windows builds Add automated Windows builds. Use curl-for-win with llvm + mingw64, and a minimal curl build with no external dependencies to build x64, ARM64 and x86 `trurl.exe`. Disable UNITY builds in curl to make `trurl` binaries about 120KB smaller each. Ref: #109 Closes #249 --- .github/workflows/curl-for-win.yml | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/curl-for-win.yml diff --git a/.github/workflows/curl-for-win.yml b/.github/workflows/curl-for-win.yml new file mode 100644 index 00000000..9720821c --- /dev/null +++ b/.github/workflows/curl-for-win.yml @@ -0,0 +1,55 @@ +# Copyright (C) Viktor Szakats. See LICENSE.md +# SPDX-License-Identifier: curl +--- +name: curl-for-win + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +permissions: {} + +env: + CW_GET: 'curl' + CW_MAP: '0' + CW_JOBS: '3' + CW_PKG_NODELETE: '1' + CW_PKG_FLATTEN: '1' + DOCKER_CONTENT_TRUST: '1' + +jobs: + win-llvm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: 'trurl' + fetch-depth: 8 + - name: 'build' + env: + CW_LLVM_MINGW_DL: '1' + CW_LLVM_MINGW_ONLY: '0' + run: | + git clone --depth 1 https://github.com/curl/curl-for-win + mv curl-for-win/* . + export CW_CONFIG='-dev-zero-nounity-win' + export CW_REVISION='${{ github.sha }}' + . ./_versions.sh + docker trust inspect --pretty "${DOCKER_IMAGE}" + time docker pull "${DOCKER_IMAGE}" + docker images --digests + time docker run --volume "$(pwd):$(pwd)" --workdir "$(pwd)" \ + --env-file <(env | grep -a -E \ + '^(CW_|GITHUB_)') \ + "${DOCKER_IMAGE}" \ + sh -c ./_ci-linux-debian.sh + + - name: 'list dependencies' + run: cat urls.txt + - uses: actions/upload-artifact@v3 + with: + name: 'trurl-windows' + retention-days: 5 + path: curl-*-*-*/trurl*