This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
build_cygwin #85
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_cygwin | |
on: | |
push: | |
paths: | |
- ".github/workflows/build_cygwin.yml" | |
pull_request: | |
paths: | |
- ".github/workflows/build_cygwin.yml" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Cygwin | |
uses: egor-tensin/setup-cygwin@v3 | |
with: | |
platform: x64 | |
packages: cmake make gcc-g++ github libiconv-devel zlib-devel clang llvm zip unzip curl sed libpcre-devel libpcre2-devel liblzma-devel gettext gettext-devel libtool automake autoconf po4a patch libdeflate-devel | |
- name: Clone source code | |
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' | |
run: | | |
git clone --recurse-submodules --depth=1 https://github.com/affggh/erofs-utils_cygwin.git -b dev erofs | |
cd erofs | |
git clone https://github.com/sekaiacg/erofs-utils extract --depth=1 | |
- name: Patch | |
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' | |
run: | | |
cd erofs | |
sh scripts/patch-all | |
- name: Install xz for liblzma | |
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' | |
run: | | |
git clone https://github.com/xz-mirror/xz xz | |
cd xz | |
./autogen.sh || true | |
./configure | |
make -j$(nproc --all) && make install | |
- name: Building | |
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' | |
run: | | |
cd erofs | |
# build | |
make | |
# output | |
ls -lh bin | |
# strip them to reduce size | |
for i in $(find bin -name \*.exe); do | |
strip --strip-unneeded $i && echo "STRIP $i" | |
done | |
- name: Repack out | |
shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' | |
run: | | |
cd erofs | |
zip -r erofs_cygwin64.zip bin | |
- name: Upload output to GH-Release | |
uses: ncipollo/release-action@v1.8.6 | |
with: | |
artifacts: C:\tools\cygwin\home\runneradmin\erofs\erofs_cygwin64.zip | |
name: "erofs-${{ github.run_number }}-cygwin64" | |
tag: "erofs-${{ github.run_number }}-cygwin64" | |
bodyFile: C:\tools\cygwin\home\runneradmin\erofs\VERSION | |
token: ${{ secrets.GITHUB_TOKEN }} |