File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed
Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 4646 run : |
4747 New-Item -ItemType Directory -ErrorAction SilentlyContinue build/cs-api-${{ steps.build_version.outputs.value }}-windows
4848 Copy-Item _build/install/default/bin/cs-api.exe build/cs-api-${{ steps.build_version.outputs.value }}-windows/
49+ - name : Download and bundle libcurl
50+ shell : bash
51+ env :
52+ SHELLOPTS : igncr
53+ run : |
54+ bash ci/static-dl \
55+ --url https://curl.se/windows/dl-8.9.1_1/curl-8.9.1_1-win64-mingw.zip \
56+ --hash f7bc9e21490d942c937dfe7bfcb9a2e29a490665c8b51e8ea0cdc171ac08c5de \
57+ --out /tmp/curl.zip
58+ mkdir /tmp/curl
59+ unzip -q /tmp/curl.zip -d /tmp/curl
60+ cp /tmp/curl/*/bin/libcurl-x64.dll build/cs-api-${{ steps.build_version.outputs.value }}-windows/libcurl-4.dll
4961 - name : Upload the compiled binary
5062 uses : actions/upload-artifact@v4
5163 with :
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77
88## Unreleased
99
10- _ There are no unreleased changes at the moment._
10+ ### Added
11+
12+ - The Windows release now ships with ` libcurl-4.dll ` (from https://curl.se/windows/ ).
1113
1214## [ 2.7.0] - 2024-08-02
1315
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ RUN apt-get update \
2828USER "$user"
2929
3030# Add script for downloading files
31- COPY --chown="$user:$user" docker /static-dl /usr/local/bin/static-dl
31+ COPY --chown="$user:$user" ci /static-dl /usr/local/bin/static-dl
3232RUN chmod +x /usr/local/bin/static-dl
3333
3434RUN mkdir "/home/$user/workdir"
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ set -o errexit
33set -o nounset
44set -o pipefail
55
6- # Download a file with `wget` and check its SHA-256 hash.
6+ # Download a file with `curl` or ` wget` and check its SHA-256 hash.
77#
88# To download with a hash check:
99#
@@ -24,20 +24,34 @@ show_hash_and_fail() {
2424 local url=$1 ; shift
2525 local file=$1 ; shift
2626
27- local hash=$( sha256sum " $file " | cut -f 1 -d " " )
27+ local hash
28+ hash=$( sha256sum " $file " | cut -f 1 -d " " )
2829 echo " Actual hash for $url : $hash " >&2
2930 return 1
3031}
3132
33+ download () {
34+ local url=$1 ; shift
35+ local out=$1 ; shift
36+
37+ # If curl is found, use it, otherwise use wget.
38+ if command -v curl > /dev/null; then
39+ curl --location --output " $out " " $url "
40+ else
41+ wget --output-document " $out " " $url "
42+ fi
43+ }
44+
3245main () {
3346 local url=$1 ; shift
3447 local hash_=$1 ; shift
3548 local out=$1 ; shift
3649
37- local tmp_dir=$( mktemp --directory)
50+ local tmp_dir
51+ tmp_dir=$( mktemp --directory)
3852 local tmp_file=" $tmp_dir /downloaded"
3953
40- wget -nv -O " $tmp_file " " $url "
54+ download " $url " " $tmp_file "
4155 echo " $hash_ $tmp_file " | sha256sum --check --strict \
4256 || show_hash_and_fail " $url " " $tmp_file "
4357
You can’t perform that action at this time.
0 commit comments