Skip to content

https://github.com/lifenjoiner/wget-for-windows.git #37

https://github.com/lifenjoiner/wget-for-windows.git

https://github.com/lifenjoiner/wget-for-windows.git #37

name: wget-for-windows CI
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
bits: [64]
ftype: [static-lite]
fail-fast: false
name: wget-wintls
runs-on: windows-latest
env:
mingw: mingw${{matrix.bits}}
build_type: wintls-winhashes-${{matrix.ftype}}
defaults:
run:
shell: msys2 {0}
steps:
- name: Set up ENVs for MSYS2 to inherit
shell: bash
run: |
arch="x86_64"
BRoot="${PWD}"
BDir="build/${build_type}/${mingw}"
CDir="${BDir}-config"
echo arch="$arch" >> $GITHUB_ENV
echo BRoot="$BRoot" >> $GITHUB_ENV
echo BDir="$BDir" >> $GITHUB_ENV
echo CDir="$CDir" >> $GITHUB_ENV
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{env.mingw}}
release: false
install: >-
base-devel
gperf
autoconf
automake
autoconf-archive
git
python
libcares-devel
mingw-w64-${{env.arch}}-gcc
mingw-w64-${{env.arch}}-gettext
# 克隆指定的仓库
- name: Clone wget repository
run: git clone -j$(nproc) https://github.com/lifenjoiner/wget-for-windows.git
- name: Generate configure
run: |
cd wget # 进入克隆的仓库目录
./bootstrap --skip-po
sed -i "s/-dirty\b//p" configure
- name: Install win-iconv
run: |
wget -O- https://github.com/win-iconv/win-iconv/archive/refs/tags/v0.0.8.tar.gz | tar xz
cd win-iconv-0.0.8
make -E CFLAGS=-Os -E prefix=/$mingw install
cd ..
- name: configure
run: |
mkdir -p $BDir
mkdir -p $CDir
cd $CDir
export CFLAGS+=" -Wall -D_WIN32_WINNT=0x0600 -DGNULIB_defined_ESOCK -Os"
LDFLAGS="-static -s" $BRoot/wget/configure --prefix=$BRoot/$BDir --disable-debug --disable-rpath --disable-nls --without-libpsl --without-metalink --disable-pcre --disable-pcre2 --with-winidn --enable-threads=windows
- name: Build
run: |
cd $CDir
echo -e "all:\n\n" > gnulib_po/Makefile
make
- name: Show compiled wget info
run: |
find / -name "wget.exe" 2>/dev/null
ls -l $CDir/src/wget.exe
SHA=$(sha1sum $CDir/src/wget.exe | cut -b 1-40)
echo SHA="$SHA" >> $GITHUB_ENV
$CDir/src/wget -V
- name: Upload wget
uses: actions/upload-artifact@v4
if: ${{success()}} || ${{failure()}}
with:
name: wget-${{env.mingw}}-${{env.build_type}}_${{env.SHA}}
path: |
${{env.CDir}}/src/wget.exe
- name: Get version number
run: |
VERSION=$(wget -qO- https://gitlab.com/gnuwget/wget/-/raw/master/.prev-version?ref_type=heads)
echo "wget_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: wget2-${{ env.wget_VERSION }}
allowUpdates: true
artifacts: "wget.exe"
token: ${{ secrets.GITHUB_TOKEN }}