Skip to content

Commit

Permalink
ci: add Windows builds
Browse files Browse the repository at this point in the history
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`.

Boost build performance by not building the curl tool [EXPERIMENTAL].
Use a customized curl-for-win build with disabled TLS to further reduce
footprint and build time.

Non-UNITY libcurl builds can make turl binaries about 120KB smaller, but
they require 2x build times (4m vs. 2m), so opted not to use those here.

Ref: #109
Closes #249
  • Loading branch information
vszakats committed Nov 14, 2023
1 parent af2d476 commit 38c249a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/curl-for-win.yml
Original file line number Diff line number Diff line change
@@ -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-osnotls-nocurltool-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*

0 comments on commit 38c249a

Please sign in to comment.