|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | +env: |
| 8 | + TONGSUO_VERSION: 8.3.2 |
| 9 | + |
| 10 | +jobs: |
| 11 | + new_release: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + outputs: |
| 14 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 15 | + steps: |
| 16 | + - name: Create Release |
| 17 | + id: create_release |
| 18 | + uses: actions/create-release@v1 |
| 19 | + env: |
| 20 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 21 | + with: |
| 22 | + tag_name: ${{ github.ref }} |
| 23 | + release_name: Release ${{ github.ref }} |
| 24 | + body: | |
| 25 | + Changes in this Release |
| 26 | + - First Change |
| 27 | + - Second Change |
| 28 | + draft: true |
| 29 | + prerelease: true |
| 30 | + build_linux_macos: |
| 31 | + runs-on: ${{ matrix.builder }} |
| 32 | + needs: [new_release] |
| 33 | + timeout-minutes: 60 |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + builder: [macos-latest, ubuntu-latest] |
| 37 | + name: "build-${{ matrix.builder }}" |
| 38 | + steps: |
| 39 | + - name: install dependencies on Linux |
| 40 | + if: ${{ matrix.builder == 'ubuntu-latest' }} |
| 41 | + run: | |
| 42 | + sudo apt-get install -y automake autoconf autoconf-archive autopoint \ |
| 43 | + flex texinfo gperf pkg-config make libhttp-daemon-perl \ |
| 44 | + libio-socket-ssl-perl libidn2-dev gettext texlive python3 valgrind \ |
| 45 | + language-pack-tr language-pack-ru |
| 46 | + - name: 'brew bundle' |
| 47 | + if: ${{ matrix.builder == 'macos-latest' }} |
| 48 | + run: | |
| 49 | + echo libtool automake autoconf autoconf-archive | xargs -Ix -n1 echo brew '"x"' > /tmp/Brewfile |
| 50 | + - name: 'brew install' |
| 51 | + if: ${{ matrix.builder == 'macos-latest' }} |
| 52 | + run: brew update && for i in 1 2 3; do brew bundle install --no-lock --file /tmp/Brewfile && break || sleep 1; done |
| 53 | + - name: build Tongsuo |
| 54 | + run: | |
| 55 | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${TONGSUO_VERSION}.tar.gz" |
| 56 | + tar zxf "${TONGSUO_VERSION}.tar.gz" |
| 57 | + pushd "Tongsuo-${TONGSUO_VERSION}" |
| 58 | + ./config --prefix=${RUNNER_TEMP}/tongsuo no-shared enable-ntls --release |
| 59 | + make -s -j4 |
| 60 | + make install_sw |
| 61 | + popd |
| 62 | + - uses: actions/checkout@v3 |
| 63 | + with: |
| 64 | + path: wget |
| 65 | + - name: build wget |
| 66 | + working-directory: ./wget |
| 67 | + run: | |
| 68 | + ./bootstrap --skip-po --no-bootstrap-sync |
| 69 | + autoreconf -fi |
| 70 | + ./configure --prefix=${RUNNER_TEMP}/wget --with-ssl=openssl --with-libssl-prefix=${RUNNER_TEMP}/tongsuo --disable-ntlm |
| 71 | + make -s -j4 |
| 72 | + make install |
| 73 | + find ${RUNNER_TEMP}/wget -type f -name wget |
| 74 | + - name: upload artifact |
| 75 | + uses: actions/upload-release-asset@v1 |
| 76 | + env: |
| 77 | + GITHUB_TOKEN: ${{ github.token }} |
| 78 | + with: |
| 79 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 80 | + asset_path: ${{ runner.temp }}/wget/bin/wget |
| 81 | + asset_name: wget-${{ runner.os }} |
| 82 | + asset_content_type: application/octet-stream |
| 83 | + build_windows: |
| 84 | + runs-on: windows-latest |
| 85 | + needs: [new_release] |
| 86 | + steps: |
| 87 | + - uses: msys2/setup-msys2@v2 |
| 88 | + with: |
| 89 | + location: ${{ runner.temp }} |
| 90 | + - name: install dependencies |
| 91 | + shell: msys2 {0} |
| 92 | + run: | |
| 93 | + pacman -S --noconfirm base-devel msys2-runtime-devel mingw-w64-x86_64-toolchain autoconf automake git gperf pkg-config autoconf-archive gcc |
| 94 | + ls -l ${RUNNER_TEMP} |
| 95 | + find ${RUNNER_TEMP} -type d -name openssl |
| 96 | + rm -rf ${RUNNER_TEMP}/msys64/mingw64/include/openssl |
| 97 | + ls -l ${RUNNER_TEMP}/msys64/mingw64/include/ |
| 98 | + - name: build Tongsuo |
| 99 | + shell: msys2 {0} |
| 100 | + run: | |
| 101 | + wget "https://github.com/Tongsuo-Project/Tongsuo/archive/refs/tags/${TONGSUO_VERSION}.tar.gz" |
| 102 | + tar zxf "${TONGSUO_VERSION}.tar.gz" |
| 103 | + pushd "Tongsuo-${TONGSUO_VERSION}" |
| 104 | + ./Configure mingw64 enable-ntls no-shared --release --prefix=${RUNNER_TEMP}/tongsuo |
| 105 | + make depend |
| 106 | + make -s -j4 |
| 107 | + make install_sw |
| 108 | + popd |
| 109 | + - uses: actions/checkout@v3 |
| 110 | + with: |
| 111 | + path: wget |
| 112 | + - name: build wget |
| 113 | + shell: msys2 {0} |
| 114 | + working-directory: ./wget |
| 115 | + run: | |
| 116 | + runner_temp=`cd ${RUNNER_TEMP} && pwd` |
| 117 | + ./bootstrap --skip-po --no-bootstrap-sync |
| 118 | + autoreconf -fi |
| 119 | + CFLAGS="-D_WIN32_WINNT=0x0601" LIBS="-lbcrypt -lcrypt32" ./configure --prefix=${runner_temp}/wget --host=mingw32 --with-ssl=openssl --with-libssl-prefix=${runner_temp}/tongsuo --disable-ntlm |
| 120 | + make -s -j4 |
| 121 | + make install |
| 122 | + find ${RUNNER_TEMP}/wget -type f -name wget.exe |
| 123 | + - name: upload artifact |
| 124 | + uses: actions/upload-release-asset@v1 |
| 125 | + env: |
| 126 | + GITHUB_TOKEN: ${{ github.token }} |
| 127 | + with: |
| 128 | + upload_url: ${{ needs.new_release.outputs.upload_url }} |
| 129 | + asset_path: ${{ runner.temp }}/wget/bin/wget.exe |
| 130 | + asset_name: wget-${{ runner.os }}.exe |
| 131 | + asset_content_type: application/octet-stream |
0 commit comments