From f37b291bf56a7b2ba38deb82332aa9f6555d9c3f Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 9 Feb 2023 22:48:30 -0800 Subject: [PATCH 1/4] Github Action to generate Win64 artifacts --- .github/workflows/windows-artifacts.yml | 69 +++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/windows-artifacts.yml diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml new file mode 100644 index 000000000..8183d428c --- /dev/null +++ b/.github/workflows/windows-artifacts.yml @@ -0,0 +1,69 @@ +name: release-artifacts + +on: + push: + branches: [ release, test_artifacts, win_artifacts ] + +permissions: read-all + +jobs: + windows-64-artifacts: + # see https://ariya.io/2020/07/on-github-actions-with-msys2 + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3 + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: make zlib git p7zip gcc + update: true + - name: display versions + run: | + make -v + gcc -v + + - name: Building zlib to static link + run: | + git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib + make -C zlib -f win32/Makefile.gcc libz.a + + - name: Building zstd programs in 64-bit mode + run: | + CPPFLAGS=-I../zlib LDFLAGS=../zlib/libz.a make -j allzstd MOREFLAGS=-static V=1 + + - name: Create artifacts + run: | + ./lib/dll/example/build_package.bat + make clean + mkdir -p bin/ + make -j -C programs zstd DEBUGFLAGS= + cp programs/zstd.exe bin/zstd.exe + git clone --depth 1 --branch release https://github.com/facebook/zstd zstd_release + cd zstd_release + git archive --format=tar release -o zstd-src.tar + ../programs/zstd -19 zstd-src.tar + sha256sum zstd-src.tar.zst > zstd-src.tar.zst.sha256.sig + cd ../bin/ + 7z a -tzip -mx9 zstd-win-release-win64.zip * + cd .. + + - name: Publish zstd-src.tar.zst Artifact + uses: actions/upload-artifact@v3 + with: + path: ${{ github.workspace }}/zstd_release/zstd-src.tar.zst + name: zstd-src.tar.zst + + - name: Publish zstd-src.tar.zst signature + uses: actions/upload-artifact@v3 + with: + path: ${{ github.workspace }}/zstd_release/zstd-src.tar.zst.sha256.sig + name: zstd-src.tar.zst.sha256.sig + + - name: Publish zstd-win-release-win64.zip + uses: actions/upload-artifact@v3 + with: + path: ${{ github.workspace }}/bin/zstd-win-release-win64.zip + name: zstd-win-release-win64.zip From 43bc470fe0ea6cb188118e27f92b9071d30371a9 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 10 Feb 2023 14:27:47 -0800 Subject: [PATCH 2/4] move shell to mingw --- .github/workflows/windows-artifacts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml index 8183d428c..5e1adfc95 100644 --- a/.github/workflows/windows-artifacts.yml +++ b/.github/workflows/windows-artifacts.yml @@ -1,4 +1,4 @@ -name: release-artifacts +name: windows-artifacts on: push: @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest defaults: run: - shell: msys2 {0} + shell: mingw64 {0} steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3 - uses: msys2/setup-msys2@v2 From 5be3f19e1d5745e50dc42c57aeda35e977de39de Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 10 Feb 2023 16:58:54 -0800 Subject: [PATCH 3/4] simplify win64 artifact generation --- .github/workflows/windows-artifacts.yml | 27 +++---------------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml index 5e1adfc95..32921d2ae 100644 --- a/.github/workflows/windows-artifacts.yml +++ b/.github/workflows/windows-artifacts.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest defaults: run: - shell: mingw64 {0} + shell: msys2 {0} steps: - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag=v3 - uses: msys2/setup-msys2@v2 @@ -23,7 +23,7 @@ jobs: - name: display versions run: | make -v - gcc -v + cc -v - name: Building zlib to static link run: | @@ -37,31 +37,10 @@ jobs: - name: Create artifacts run: | ./lib/dll/example/build_package.bat - make clean - mkdir -p bin/ - make -j -C programs zstd DEBUGFLAGS= - cp programs/zstd.exe bin/zstd.exe - git clone --depth 1 --branch release https://github.com/facebook/zstd zstd_release - cd zstd_release - git archive --format=tar release -o zstd-src.tar - ../programs/zstd -19 zstd-src.tar - sha256sum zstd-src.tar.zst > zstd-src.tar.zst.sha256.sig - cd ../bin/ + cd bin/ 7z a -tzip -mx9 zstd-win-release-win64.zip * cd .. - - name: Publish zstd-src.tar.zst Artifact - uses: actions/upload-artifact@v3 - with: - path: ${{ github.workspace }}/zstd_release/zstd-src.tar.zst - name: zstd-src.tar.zst - - - name: Publish zstd-src.tar.zst signature - uses: actions/upload-artifact@v3 - with: - path: ${{ github.workspace }}/zstd_release/zstd-src.tar.zst.sha256.sig - name: zstd-src.tar.zst.sha256.sig - - name: Publish zstd-win-release-win64.zip uses: actions/upload-artifact@v3 with: From f8ae21680f06112c509cdf474e97b6e96634a776 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Fri, 10 Feb 2023 20:49:21 -0800 Subject: [PATCH 4/4] try a different compiler --- .github/workflows/windows-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-artifacts.yml b/.github/workflows/windows-artifacts.yml index 32921d2ae..0620c42c1 100644 --- a/.github/workflows/windows-artifacts.yml +++ b/.github/workflows/windows-artifacts.yml @@ -18,7 +18,7 @@ jobs: - uses: msys2/setup-msys2@v2 with: msystem: MINGW64 - install: make zlib git p7zip gcc + install: make zlib git p7zip mingw-w64-x86_64-gcc update: true - name: display versions run: |