Skip to content

Commit 39c6029

Browse files
committed
Initial commit
0 parents  commit 39c6029

File tree

4 files changed

+180
-0
lines changed

4 files changed

+180
-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-latest
10+
name: Compile and install PHP - Test
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup PHP
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: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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 php-src 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 && sudo sed -i -- 's/# deb-src/deb-src/g' /etc/apt/sources.list
32+
sudo apt update
33+
sudo apt build-dep libcurl4-openssl-dev curl -y
34+
35+
- name: Configure build
36+
shell: bash
37+
run: |
38+
set -x
39+
cd .curl
40+
autoreconf -fi
41+
./configure --disable-symbol-hiding --enable-versioned-symbols \
42+
--enable-threaded-resolver --with-lber-lib=lber \
43+
--enable-websockets \
44+
--with-gssapi=/usr --with-nghttp2 \
45+
--includedir=/usr/include/$(DEB_HOST_MULTIARCH) \
46+
--with-zsh-functions-dir=/usr/share/zsh/vendor-completions \
47+
--with-fish-functions-dir=/usr/share/fish/vendor_completions.d \
48+
--with-ca-path=/etc/ssl/certs \
49+
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \
50+
--without-libssh --with-libssh2 \
51+
--with-openssl \
52+
--enable-http \
53+
--enable-ftp \
54+
--enable-file \
55+
--enable-ipfs \
56+
--enable-ldap \
57+
--enable-ldaps \
58+
--enable-rtsp \
59+
--enable-proxy \
60+
--enable-dict \
61+
--enable-telnet \
62+
--enable-tftp \
63+
--enable-pop3 \
64+
--enable-imap \
65+
--enable-smb \
66+
--enable-smtp \
67+
--enable-gopher \
68+
--enable-mqtt \
69+
--enable-manual \
70+
--enable-docs \
71+
--enable-ipv6 \
72+
--enable-pthreads \
73+
--enable-verbose \
74+
--enable-sspi \
75+
--enable-basic-auth \
76+
--enable-bearer-auth \
77+
--enable-digest-auth \
78+
--enable-kerberos-auth \
79+
--enable-negotiate-auth \
80+
--enable-aws \
81+
--enable-ntlm \
82+
--enable-tls-srp \
83+
--enable-unix-sockets \
84+
--enable-cookies \
85+
--enable-socketpair \
86+
--enable-http-auth
87+
88+
cd ../
89+
90+
- name: Compile
91+
shell: bash
92+
run: |
93+
cd ./.curl
94+
make -j$(/usr/bin/nproc) >/dev/null
95+
cd ../
96+
97+
- name: Install
98+
shell: bash
99+
run: |
100+
set -x
101+
cd ./.curl
102+
sudo make install
103+
cd ../
104+
105+
- name: Enable opcache
106+
shell: bash
107+
run: |
108+
curl --version
109+
110+
- name: Cleanup
111+
shell: bash
112+
run: |
113+
rm .curl -Rf

0 commit comments

Comments
 (0)