Skip to content

Commit 8fb37d2

Browse files
authored
Merge pull request #4 from dongbeiouba/833
curl基于铜锁支持国密HTTPS
2 parents a426b50 + dc539f4 commit 8fb37d2

File tree

4 files changed

+1259
-0
lines changed

4 files changed

+1259
-0
lines changed

.github/workflows/release.yml

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Copyright (C) 2023
2+
#
3+
# SPDX-License-Identifier: curl
4+
5+
name: release
6+
7+
on:
8+
workflow_dispatch:
9+
tags:
10+
- '*'
11+
12+
jobs:
13+
new_release:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
upload_url: ${{ steps.create_release.outputs.upload_url }}
17+
steps:
18+
- name: Create Release
19+
id: create_release
20+
uses: actions/create-release@v1
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Release ${{ github.ref }}
26+
body: |
27+
Changes in this Release
28+
- First Change
29+
- Second Change
30+
draft: true
31+
prerelease: true
32+
build_linux_macos:
33+
runs-on: ${{ matrix.builder }}
34+
needs: [new_release]
35+
strategy:
36+
matrix:
37+
builder: [macos-latest, ubuntu-20.04]
38+
name: "build-${{ matrix.builder }}"
39+
steps:
40+
- run: brew install libtool autoconf automake pkg-config
41+
if: ${{ matrix.builder == 'macos-latest' }}
42+
- name: build Tongsuo
43+
run: |
44+
VERSION=8.3.3
45+
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${VERSION}.tar.gz"
46+
tar zxf "${VERSION}.tar.gz"
47+
pushd "Tongsuo-${VERSION}"
48+
./config --prefix=${GITHUB_WORKSPACE}/tongsuo no-shared enable-ntls --release
49+
make -s -j4
50+
make install_sw
51+
popd
52+
- uses: actions/checkout@v2
53+
with:
54+
path: curl
55+
fetch-depth: 0
56+
- name: build curl
57+
working-directory: ./curl
58+
run: |
59+
git apply tongsuo.patch
60+
autoreconf -fi
61+
./configure --enable-warnings --enable-werror --with-openssl=${GITHUB_WORKSPACE}/tongsuo --without-zlib --without-brotli --disable-shared --disable-ldap --disable-ldaps --disable-rtsp --without-librtmp --enable-static
62+
make -s -j4
63+
64+
- name: upload artifact
65+
uses: actions/upload-release-asset@v1
66+
env:
67+
GITHUB_TOKEN: ${{ github.token }}
68+
with:
69+
upload_url: ${{ needs.new_release.outputs.upload_url }}
70+
asset_path: ./curl/src/curl
71+
asset_name: curl-${{ runner.os }}
72+
asset_content_type: application/octet-stream
73+
74+
build_windows:
75+
runs-on: windows-latest
76+
needs: [new_release]
77+
steps:
78+
- run: choco install -y winrar
79+
- uses: ilammy/msvc-dev-cmd@v1
80+
with:
81+
arch: win64
82+
- uses: ilammy/setup-nasm@v1
83+
with:
84+
platform: win64
85+
- uses: shogo82148/actions-setup-perl@v1
86+
- name: Export env
87+
shell: bash
88+
run: |
89+
VERSION=8.3.3
90+
echo "TONGSUO_VERSION=${VERSION}" >> $GITHUB_ENV
91+
echo "TONGSUO_HOME=${GITHUB_WORKSPACE}\tongsuo${VERSION}" >> $GITHUB_ENV
92+
- name: Download Tongsuo source
93+
run: |
94+
wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${env:TONGSUO_VERSION}.tar.gz" -OutFile "${env:TONGSUO_VERSION}.tar.gz"
95+
shell: powershell
96+
- run: '"C:\Program Files\WinRAR\WinRAR.exe" -INUL x %TONGSUO_VERSION%.tar.gz'
97+
shell: cmd
98+
- name: Build Tongsuo
99+
shell: cmd
100+
run: |
101+
pushd "Tongsuo-%TONGSUO_VERSION%"
102+
mkdir _build
103+
pushd _build
104+
perl ..\Configure no-makedepend no-shared VC-WIN64A --prefix=%TONGSUO_HOME%
105+
nmake /S
106+
nmake install_sw
107+
popd
108+
popd
109+
- uses: actions/checkout@v2
110+
with:
111+
path: curl
112+
fetch-depth: 0
113+
- name: build curl
114+
working-directory: ./curl
115+
shell: powershell
116+
run: |
117+
git apply tongsuo.diff
118+
./buildconf.bat
119+
cd winbuild
120+
nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static
121+
- name: upload artifact
122+
uses: actions/upload-release-asset@v1
123+
env:
124+
GITHUB_TOKEN: ${{ github.token }}
125+
with:
126+
upload_url: ${{ needs.new_release.outputs.upload_url }}
127+
asset_path: .\curl\builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe
128+
asset_name: curl-${{ runner.os }}.exe
129+
asset_content_type: application/octet-stream

.github/workflows/reuse.yml

+4
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v4
28+
- name: patch tongsuo
29+
run: |
30+
git apply tongsuo.patch
31+
rm -f tongsuo.patch
2832
- name: REUSE Compliance Check
2933
uses: fsfe/reuse-action@v2

.github/workflows/tongsuo.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (C) 2022
2+
#
3+
# SPDX-License-Identifier: curl
4+
5+
name: build-with-tongsuo
6+
7+
on: [workflow_dispatch, pull_request, push]
8+
9+
jobs:
10+
autotools:
11+
runs-on: 'ubuntu-latest'
12+
timeout-minutes: 60
13+
14+
steps:
15+
- name: checkout tongsuo
16+
uses: actions/checkout@v2
17+
with:
18+
repository: Tongsuo-Project/Tongsuo
19+
path: Tongsuo
20+
- name: install Tongsuo
21+
working-directory: ./Tongsuo
22+
run: |
23+
./config --banner=Configured --prefix=${GITHUB_WORKSPACE}/install enable-ntls
24+
make -s -j4
25+
make install
26+
- uses: actions/checkout@v3
27+
with:
28+
path: curl
29+
30+
- name: build curl
31+
working-directory: ./curl
32+
run: |
33+
git apply tongsuo.patch
34+
autoreconf -fi
35+
LDFLAGS=-Wl,-rpath=${GITHUB_WORKSPACE}/install/lib64/ ./configure --enable-warnings --enable-werror --with-openssl=${GITHUB_WORKSPACE}/install
36+
make V=1
37+
make V=1 examples
38+
make V=1 -C tests
39+
make V=1 test-ci

0 commit comments

Comments
 (0)