|
| 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-latest] |
| 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.2 |
| 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 | + autoreconf -fi |
| 60 | + ./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 |
| 61 | + make -s -j4 |
| 62 | + |
| 63 | + - name: upload artifact |
| 64 | + uses: actions/upload-release-asset@v1 |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ github.token }} |
| 67 | + with: |
| 68 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 69 | + asset_path: ./curl/src/curl |
| 70 | + asset_name: curl-${{ runner.os }} |
| 71 | + asset_content_type: application/octet-stream |
| 72 | + |
| 73 | + build_windows: |
| 74 | + runs-on: windows-latest |
| 75 | + needs: [new_release] |
| 76 | + steps: |
| 77 | + - run: choco install -y winrar |
| 78 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 79 | + with: |
| 80 | + arch: win64 |
| 81 | + - uses: ilammy/setup-nasm@v1 |
| 82 | + with: |
| 83 | + platform: win64 |
| 84 | + - uses: shogo82148/actions-setup-perl@v1 |
| 85 | + - name: Export env |
| 86 | + shell: bash |
| 87 | + run: | |
| 88 | + VERSION=8.3.2 |
| 89 | + echo "TONGSUO_VERSION=${VERSION}" >> $GITHUB_ENV |
| 90 | + echo "TONGSUO_HOME=${GITHUB_WORKSPACE}\tongsuo${VERSION}" >> $GITHUB_ENV |
| 91 | + - name: Download Tongsuo source |
| 92 | + run: | |
| 93 | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${env:TONGSUO_VERSION}.tar.gz" -OutFile "${env:TONGSUO_VERSION}.tar.gz" |
| 94 | + shell: powershell |
| 95 | + - run: '"C:\Program Files\WinRAR\WinRAR.exe" -INUL x %TONGSUO_VERSION%.tar.gz' |
| 96 | + shell: cmd |
| 97 | + - name: Build Tongsuo |
| 98 | + shell: cmd |
| 99 | + run: | |
| 100 | + pushd "Tongsuo-%TONGSUO_VERSION%" |
| 101 | + mkdir _build |
| 102 | + pushd _build |
| 103 | + perl ..\Configure no-makedepend no-shared VC-WIN64A --prefix=%TONGSUO_HOME% |
| 104 | + nmake /S |
| 105 | + nmake install_sw |
| 106 | + popd |
| 107 | + popd |
| 108 | + - uses: actions/checkout@v2 |
| 109 | + with: |
| 110 | + path: curl |
| 111 | + fetch-depth: 0 |
| 112 | + - name: build curl |
| 113 | + working-directory: ./curl |
| 114 | + shell: powershell |
| 115 | + run: | |
| 116 | + ./buildconf.bat |
| 117 | + cd winbuild |
| 118 | + nmake /f Makefile.vc mode=static WITH_SSL=static SSL_PATH=${env:TONGSUO_HOME} RTLIBCFG=static |
| 119 | + - name: upload artifact |
| 120 | + uses: actions/upload-release-asset@v1 |
| 121 | + env: |
| 122 | + GITHUB_TOKEN: ${{ github.token }} |
| 123 | + with: |
| 124 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 125 | + asset_path: .\curl\builds\libcurl-vc-x64-release-static-ssl-static-ipv6-sspi\bin\curl.exe |
| 126 | + asset_name: curl-${{ runner.os }}.exe |
| 127 | + asset_content_type: application/octet-stream |
0 commit comments