Skip to content

Commit 9a42414

Browse files
committed
Initial commit
0 parents  commit 9a42414

File tree

4 files changed

+185
-0
lines changed

4 files changed

+185
-0
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Tests
2+
permissions: read-all
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-24.04
10+
name: Compile and install Curl
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Curl
15+
uses: PHPWatch/setup-curl@main
16+
17+
- name: Display versions and env
18+
run: |
19+
curl --version

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 PHP Watch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Compile PHP - GitHub Actions
2+
3+
This GitHub action downloads the latest Curl release (curl),
4+
configures it to enable all features, compiles it, and installs it.
5+
6+
## Usage
7+
8+
```yaml
9+
name: Tests
10+
permissions: read-all
11+
on:
12+
pull_request:
13+
push:
14+
15+
jobs:
16+
run:
17+
runs-on: ubuntu-latest
18+
name: Compile and install PHP - Test
19+
steps:
20+
- name: Setup PHP
21+
uses: PHPWatch/setup-curl@main
22+
23+
- name: Display versions and env
24+
run: |
25+
curl --version
26+
27+
```

action.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Compile and install Curl from source
2+
description: Compile and install Curl from source
3+
runs:
4+
using: composite
5+
steps:
6+
7+
- name: Show existing env
8+
shell: bash
9+
run: |
10+
curl --version
11+
12+
- name: Checkout curl repo
13+
uses: actions/checkout@v4
14+
with:
15+
repository: curl/curl
16+
path: .curl
17+
fetch-depth: 0
18+
19+
- name: Checkout latest release tag
20+
shell: bash
21+
run: |
22+
cd .curl
23+
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
24+
git checkout $LATEST_TAG
25+
cd ../
26+
27+
- name: Install dependencies
28+
shell: bash
29+
run: |
30+
set -x
31+
sudo sed -i -- 's/#deb-src/deb-src/g' /etc/apt/sources.list
32+
sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
33+
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
34+
sudo apt update
35+
sudo apt build-dep libcurl4-openssl-dev curl -y
36+
sudo apt install libgsasl-dev -y
37+
38+
- name: Configure build
39+
shell: bash
40+
run: |
41+
set -x
42+
cd .curl
43+
autoreconf -fi
44+
./configure --disable-symbol-hiding --enable-versioned-symbols \
45+
--enable-threaded-resolver --with-lber-lib=lber \
46+
--enable-websockets \
47+
--with-gssapi=/usr --with-nghttp2 \
48+
--includedir=/usr/include/$(DEB_HOST_MULTIARCH) \
49+
--with-zsh-functions-dir=/usr/share/zsh/vendor-completions \
50+
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d \
51+
--with-ca-path=/etc/ssl/certs \
52+
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
53+
--without-libssh --with-libssh2 \
54+
--with-openssl \
55+
--enable-http \
56+
--enable-ftp \
57+
--enable-file \
58+
--enable-ipfs \
59+
--enable-ldap \
60+
--enable-ldaps \
61+
--enable-rtsp \
62+
--enable-proxy \
63+
--enable-dict \
64+
--enable-telnet \
65+
--enable-tftp \
66+
--enable-pop3 \
67+
--enable-imap \
68+
--enable-smb \
69+
--enable-smtp \
70+
--enable-gopher \
71+
--enable-mqtt \
72+
--enable-manual \
73+
--enable-docs \
74+
--enable-ipv6 \
75+
--enable-pthreads \
76+
--enable-verbose \
77+
--enable-sspi \
78+
--enable-basic-auth \
79+
--enable-bearer-auth \
80+
--enable-digest-auth \
81+
--enable-kerberos-auth \
82+
--enable-negotiate-auth \
83+
--enable-aws \
84+
--enable-ntlm \
85+
--enable-tls-srp \
86+
--enable-unix-sockets \
87+
--enable-cookies \
88+
--enable-socketpair \
89+
--enable-sspi \
90+
--enable-http-auth
91+
92+
cd ../
93+
94+
- name: Compile
95+
shell: bash
96+
run: |
97+
cd ./.curl
98+
make -j$(/usr/bin/nproc) >/dev/null
99+
cd ../
100+
101+
- name: Install
102+
shell: bash
103+
run: |
104+
set -x
105+
cd ./.curl
106+
sudo make install
107+
sudo ldconfig
108+
cd ../
109+
110+
- name: Show version info
111+
shell: bash
112+
run: |
113+
curl --version
114+
115+
- name: Cleanup
116+
shell: bash
117+
run: |
118+
rm .curl -Rf

0 commit comments

Comments
 (0)