build-and-release #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-and-release | |
on: | |
# run it manually | |
workflow_dispatch: | |
jobs: | |
build-Linux: | |
name: build-Linux (${{ github.ref_name }}) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Cross Build Static cURL | |
env: | |
ARCHES: ${{ vars.ARCHES_LINUX_GLIBC }} | |
CURL_VERSION: ${{ vars.CURL_VERSION }} | |
TLS_LIB: ${{ vars.TLS_LIB }} | |
QUICTLS_VERSION: ${{ vars.QUICTLS_VERSION }} | |
OPENSSL_VERSION: ${{ vars.OPENSSL_VERSION }} | |
NGTCP2_VERSION: ${{ vars.NGTCP2_VERSION }} | |
NGHTTP3_VERSION: ${{ vars.NGHTTP3_VERSION }} | |
NGHTTP2_VERSION: ${{ vars.NGHTTP2_VERSION }} | |
LIBIDN2_VERSION: ${{ vars.LIBIDN2_VERSION }} | |
LIBUNISTRING_VERSION: ${{ vars.LIBUNISTRING_VERSION }} | |
ZLIB_VERSION: ${{ vars.ZLIB_VERSION }} | |
BROTLI_VERSION: ${{ vars.BROTLI_VERSION }} | |
ZSTD_VERSION: ${{ vars.ZSTD_VERSION }} | |
LIBSSH2_VERSION: ${{ vars.LIBSSH2_VERSION }} | |
ARES_VERSION: ${{ vars.ARES_VERSION }} | |
ENABLE_TRURL: ${{ vars.ENABLE_TRURL }} | |
TRURL_VERSION: ${{ vars.TRURL_VERSION }} | |
LIBC: glibc | |
STATIC_LIBRARY: 1 | |
CONTAINER_IMAGE: debian:latest | |
TOKEN_READ: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ARCHES="${ARCHES}" | |
CURL_VERSION=${CURL_VERSION} | |
TLS_LIB=${TLS_LIB} | |
QUICTLS_VERSION=${QUICTLS_VERSION} | |
OPENSSL_VERSION=${OPENSSL_VERSION} | |
NGTCP2_VERSION=${NGTCP2_VERSION} | |
NGHTTP3_VERSION=${NGHTTP3_VERSION} | |
NGHTTP2_VERSION=${NGHTTP2_VERSION} | |
LIBIDN2_VERSION=${LIBIDN2_VERSION} | |
LIBUNISTRING_VERSION=${LIBUNISTRING_VERSION} | |
ZLIB_VERSION=${ZLIB_VERSION} | |
BROTLI_VERSION=${BROTLI_VERSION} | |
ZSTD_VERSION=${ZSTD_VERSION} | |
LIBSSH2_VERSION=${LIBSSH2_VERSION} | |
ARES_VERSION=${ARES_VERSION} | |
ENABLE_TRURL=${ENABLE_TRURL} | |
TRURL_VERSION=${TRURL_VERSION} | |
LIBC=${LIBC} | |
STATIC_LIBRARY=${STATIC_LIBRARY} | |
CONTAINER_IMAGE=${CONTAINER_IMAGE} | |
TOKEN_READ=${TOKEN_READ} | |
sh curl-static-cross.sh | |
- name: Set up environment | |
run: | | |
VERSION=`cat release/version.txt` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Upload artifact (version) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-version | |
path: release/version.txt | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-binary-linux-${{ env.VERSION }} | |
path: release | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
build-Linux-musl: | |
name: build-Linux-musl (${{ github.ref_name }}) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Cross Build Static cURL | |
env: | |
ARCHES: ${{ vars.ARCHES_LINUX_MUSL }} | |
CURL_VERSION: ${{ vars.CURL_VERSION }} | |
TLS_LIB: ${{ vars.TLS_LIB }} | |
QUICTLS_VERSION: ${{ vars.QUICTLS_VERSION }} | |
OPENSSL_VERSION: ${{ vars.OPENSSL_VERSION }} | |
NGTCP2_VERSION: ${{ vars.NGTCP2_VERSION }} | |
NGHTTP3_VERSION: ${{ vars.NGHTTP3_VERSION }} | |
NGHTTP2_VERSION: ${{ vars.NGHTTP2_VERSION }} | |
LIBIDN2_VERSION: ${{ vars.LIBIDN2_VERSION }} | |
LIBUNISTRING_VERSION: ${{ vars.LIBUNISTRING_VERSION }} | |
ZLIB_VERSION: ${{ vars.ZLIB_VERSION }} | |
BROTLI_VERSION: ${{ vars.BROTLI_VERSION }} | |
ZSTD_VERSION: ${{ vars.ZSTD_VERSION }} | |
LIBSSH2_VERSION: ${{ vars.LIBSSH2_VERSION }} | |
ARES_VERSION: ${{ vars.ARES_VERSION }} | |
ENABLE_TRURL: ${{ vars.ENABLE_TRURL }} | |
TRURL_VERSION: ${{ vars.TRURL_VERSION }} | |
LIBC: musl | |
CONTAINER_IMAGE: debian:latest | |
TOKEN_READ: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ARCHES="${ARCHES}" | |
CURL_VERSION=${CURL_VERSION} | |
TLS_LIB=${TLS_LIB} | |
QUICTLS_VERSION=${QUICTLS_VERSION} | |
OPENSSL_VERSION=${OPENSSL_VERSION} | |
NGTCP2_VERSION=${NGTCP2_VERSION} | |
NGHTTP3_VERSION=${NGHTTP3_VERSION} | |
NGHTTP2_VERSION=${NGHTTP2_VERSION} | |
LIBIDN2_VERSION=${LIBIDN2_VERSION} | |
LIBUNISTRING_VERSION=${LIBUNISTRING_VERSION} | |
ZLIB_VERSION=${ZLIB_VERSION} | |
BROTLI_VERSION=${BROTLI_VERSION} | |
ZSTD_VERSION=${ZSTD_VERSION} | |
LIBSSH2_VERSION=${LIBSSH2_VERSION} | |
ARES_VERSION=${ARES_VERSION} | |
ENABLE_TRURL=${ENABLE_TRURL} | |
TRURL_VERSION=${TRURL_VERSION} | |
LIBC=${LIBC} | |
CONTAINER_IMAGE=${CONTAINER_IMAGE} | |
TOKEN_READ=${TOKEN_READ} | |
sh curl-static-cross.sh | |
- name: Set up environment | |
run: | | |
VERSION=`cat release/version.txt` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Upload artifact (version) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-version | |
path: release/version.txt | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-binary-linux-musl-${{ env.VERSION }} | |
path: release | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
build-Windows: | |
name: build-Windows (${{ github.ref_name }}) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Cross Build Static cURL | |
env: | |
ARCHES: ${{ vars.ARCHES_WINDOWS }} | |
CURL_VERSION: ${{ vars.CURL_VERSION }} | |
TLS_LIB: ${{ vars.TLS_LIB }} | |
QUICTLS_VERSION: ${{ vars.QUICTLS_VERSION }} | |
OPENSSL_VERSION: ${{ vars.OPENSSL_VERSION }} | |
NGTCP2_VERSION: ${{ vars.NGTCP2_VERSION }} | |
NGHTTP3_VERSION: ${{ vars.NGHTTP3_VERSION }} | |
NGHTTP2_VERSION: ${{ vars.NGHTTP2_VERSION }} | |
LIBIDN2_VERSION: ${{ vars.LIBIDN2_VERSION }} | |
LIBUNISTRING_VERSION: ${{ vars.LIBUNISTRING_VERSION }} | |
ZLIB_VERSION: ${{ vars.ZLIB_VERSION }} | |
BROTLI_VERSION: ${{ vars.BROTLI_VERSION }} | |
ZSTD_VERSION: ${{ vars.ZSTD_VERSION }} | |
LIBSSH2_VERSION: ${{ vars.LIBSSH2_VERSION }} | |
ARES_VERSION: ${{ vars.ARES_VERSION }} | |
ENABLE_TRURL: ${{ vars.ENABLE_TRURL }} | |
TRURL_VERSION: ${{ vars.TRURL_VERSION }} | |
CONTAINER_IMAGE: mstorsjo/llvm-mingw:latest | |
TOKEN_READ: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ARCHES="${ARCHES}" | |
CURL_VERSION=${CURL_VERSION} | |
TLS_LIB=${TLS_LIB} | |
QUICTLS_VERSION=${QUICTLS_VERSION} | |
OPENSSL_VERSION=${OPENSSL_VERSION} | |
NGTCP2_VERSION=${NGTCP2_VERSION} | |
NGHTTP3_VERSION=${NGHTTP3_VERSION} | |
NGHTTP2_VERSION=${NGHTTP2_VERSION} | |
LIBIDN2_VERSION=${LIBIDN2_VERSION} | |
LIBUNISTRING_VERSION=${LIBUNISTRING_VERSION} | |
ZLIB_VERSION=${ZLIB_VERSION} | |
BROTLI_VERSION=${BROTLI_VERSION} | |
ZSTD_VERSION=${ZSTD_VERSION} | |
LIBSSH2_VERSION=${LIBSSH2_VERSION} | |
ARES_VERSION=${ARES_VERSION} | |
ENABLE_TRURL=${ENABLE_TRURL} | |
TRURL_VERSION=${TRURL_VERSION} | |
CONTAINER_IMAGE=${CONTAINER_IMAGE} | |
TOKEN_READ=${TOKEN_READ} | |
sh curl-static-win.sh | |
- name: Set up environment | |
run: | | |
VERSION=`cat release/version.txt` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Upload artifact (version) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-version | |
path: release/version.txt | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-binary-windows-${{ env.VERSION }} | |
path: release | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
build-macOS: | |
name: build-macOS (${{ github.ref_name }}) | |
runs-on: macos-latest | |
steps: | |
- name: Set variables | |
run: | | |
echo "MACOS_RELEASE_DIR=${HOME}" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Build Static cURL on macOS | |
env: | |
ARCHES: ${{ vars.ARCHES_MACOS }} | |
CURL_VERSION: ${{ vars.CURL_VERSION }} | |
TLS_LIB: ${{ vars.TLS_LIB }} | |
QUICTLS_VERSION: ${{ vars.QUICTLS_VERSION }} | |
OPENSSL_VERSION: ${{ vars.OPENSSL_VERSION }} | |
NGTCP2_VERSION: ${{ vars.NGTCP2_VERSION }} | |
NGHTTP3_VERSION: ${{ vars.NGHTTP3_VERSION }} | |
NGHTTP2_VERSION: ${{ vars.NGHTTP2_VERSION }} | |
LIBIDN2_VERSION: ${{ vars.LIBIDN2_VERSION }} | |
LIBUNISTRING_VERSION: ${{ vars.LIBUNISTRING_VERSION }} | |
ZLIB_VERSION: ${{ vars.ZLIB_VERSION }} | |
BROTLI_VERSION: ${{ vars.BROTLI_VERSION }} | |
ZSTD_VERSION: ${{ vars.ZSTD_VERSION }} | |
LIBSSH2_VERSION: ${{ vars.LIBSSH2_VERSION }} | |
ARES_VERSION: ${{ vars.ARES_VERSION }} | |
TOKEN_READ: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ARCHES="${ARCHES}" | |
CURL_VERSION=${CURL_VERSION} | |
TLS_LIB=${TLS_LIB} | |
QUICTLS_VERSION=${QUICTLS_VERSION} | |
OPENSSL_VERSION=${OPENSSL_VERSION} | |
NGTCP2_VERSION=${NGTCP2_VERSION} | |
NGHTTP3_VERSION=${NGHTTP3_VERSION} | |
NGHTTP2_VERSION=${NGHTTP2_VERSION} | |
LIBIDN2_VERSION=${LIBIDN2_VERSION} | |
LIBUNISTRING_VERSION=${LIBUNISTRING_VERSION} | |
ZLIB_VERSION=${ZLIB_VERSION} | |
BROTLI_VERSION=${BROTLI_VERSION} | |
ZSTD_VERSION=${ZSTD_VERSION} | |
LIBSSH2_VERSION=${LIBSSH2_VERSION} | |
ARES_VERSION=${ARES_VERSION} | |
TOKEN_READ=${TOKEN_READ} | |
bash curl-static-mac.sh | |
- name: Set up environment | |
run: | | |
VERSION=`cat ${{ env.MACOS_RELEASE_DIR }}/version.txt` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Upload artifact (version) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-version | |
path: ${{ env.MACOS_RELEASE_DIR }}/version.txt | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-binary-macos-${{ env.VERSION }} | |
path: ${{ env.MACOS_RELEASE_DIR }}/release | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true | |
release: | |
name: release curl (${{ github.ref_name }}) | |
needs: [build-Linux, build-Linux-musl, build-Windows, build-macOS] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: curl-version | |
path: curl-version | |
- name: Set up environment | |
run: | | |
VERSION=`cat curl-version/version.txt` | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Download artifact (linux) | |
uses: actions/download-artifact@v4 | |
with: | |
name: curl-binary-linux-${{ env.VERSION }} | |
path: release | |
- name: Download artifact (linux-musl) | |
uses: actions/download-artifact@v4 | |
with: | |
name: curl-binary-linux-musl-${{ env.VERSION }} | |
path: release | |
- name: Download artifact (macos) | |
uses: actions/download-artifact@v4 | |
with: | |
name: curl-binary-macos-${{ env.VERSION }} | |
path: release | |
- name: Download artifact (windows) | |
uses: actions/download-artifact@v4 | |
with: | |
name: curl-binary-windows-${{ env.VERSION }} | |
path: release | |
- name: List compiled files | |
run: | | |
ls -l release/* | |
echo | |
file release/bin/curl-* | |
echo | |
cat release/version-info.txt | |
echo | |
sha256sum release/bin/curl-* | |
- name: Compress and Create Release Note | |
env: | |
TLS_LIB: ${{ vars.TLS_LIB }} | |
run: | | |
TLS_LIB=${TLS_LIB} | |
bash release.sh | |
- name: List compressed files | |
run: ls -l release/* | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: github.ref == 'refs/heads/main' | |
with: | |
files: | | |
release/bin/curl-*.tar.xz | |
release/curl-*.tar.xz | |
body_path: release/release.md | |
tag_name: ${{ env.VERSION }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: curl-release-${{ env.VERSION }} | |
path: release | |
retention-days: 90 | |
if-no-files-found: error | |
overwrite: true |