diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..97fcf1e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: Tests +permissions: read-all +on: + pull_request: + push: + +jobs: + run: + runs-on: ubuntu-latest + name: Compile and install PHP - Test + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: PHPWatch/setup-curl@main + + - name: Display versions and env + run: | + curl --version diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9c614a3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 PHP Watch + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa563f7 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Compile PHP - GitHub Actions + +This GitHub action downloads the latest Curl release (curl), +configures it to enable all features, compiles it, and installs it. + +## Usage + +```yaml +name: Tests +permissions: read-all +on: + pull_request: + push: + +jobs: + run: + runs-on: ubuntu-latest + name: Compile and install PHP - Test + steps: + - name: Setup PHP + uses: PHPWatch/setup-curl@main + + - name: Display versions and env + run: | + curl --version + +``` diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..7944ff5 --- /dev/null +++ b/action.yml @@ -0,0 +1,114 @@ +name: Compile and install Curl from source +description: Compile and install Curl from source +runs: + using: composite + steps: + + - name: Show existing env + shell: bash + run: | + curl --version + + - name: Checkout php-src repo + uses: actions/checkout@v4 + with: + repository: curl/curl + path: .curl + fetch-depth: 0 + + - name: Checkout latest release tag + shell: bash + run: | + cd .curl + LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + git checkout $LATEST_TAG + cd ../ + + - name: Install dependencies + shell: bash + run: | + set -x + 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 + sudo apt update + sudo apt build-dep libcurl4-openssl-dev curl -y + + - name: Configure build + shell: bash + run: | + set -x + cd .curl + autoreconf -fi + ./configure --disable-symbol-hiding --enable-versioned-symbols \ + --enable-threaded-resolver --with-lber-lib=lber \ + --enable-websockets \ + --with-gssapi=/usr --with-nghttp2 \ + --includedir=/usr/include/$(DEB_HOST_MULTIARCH) \ + --with-zsh-functions-dir=/usr/share/zsh/vendor-completions \ + --with-fish-functions-dir=/usr/share/fish/vendor_completions.d \ + --with-ca-path=/etc/ssl/certs \ + --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \ + --without-libssh --with-libssh2 \ + --with-openssl \ + --enable-code-coverage \ + --enable-http \ + --enable-ftp \ + --enable-file \ + --enable-ipfs \ + --enable-ldap \ + --enable-ldaps \ + --enable-rtsp \ + --enable-proxy \ + --enable-dict \ + --enable-telnet \ + --enable-tftp \ + --enable-pop3 \ + --enable-imap \ + --enable-smb \ + --enable-smtp \ + --enable-gopher \ + --enable-mqtt \ + --enable-manual \ + --enable-docs \ + --enable-ipv6 \ + --enable-pthreads \ + --enable-verbose \ + --enable-sspi \ + --enable-basic-auth \ + --enable-bearer-auth \ + --enable-digest-auth \ + --enable-kerberos-auth \ + --enable-negotiate-auth \ + --enable-aws \ + --enable-ntlm \ + --enable-tls-srp \ + --enable-unix-sockets \ + --enable-cookies \ + --enable-socketpair \ + --enable-http-auth + + cd ../ + + - name: Compile + shell: bash + run: | + cd ./.curl + make -j$(/usr/bin/nproc) >/dev/null + cd ../ + + - name: Install + shell: bash + run: | + set -x + cd ./.curl + sudo make install + cd ../ + + - name: Enable opcache + shell: bash + run: | + curl --version + + - name: Cleanup + shell: bash + run: | + rm .curl -Rf