• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: windows-artifacts
2
3on:
4  push:
5    branches: [ test_artifacts, win_artifacts ]
6  release:
7    types:
8      - published
9
10permissions: read-all
11
12jobs:
13  windows-artifacts:
14    # see https://ariya.io/2020/07/on-github-actions-with-msys2
15    runs-on: windows-latest
16    # see https://github.com/msys2/setup-msys2
17    strategy:
18      matrix:
19        include:
20          - { msystem: mingw64, env: x86_64, ziparch: win64 }
21          - { msystem: mingw32, env: i686, ziparch: win32 }
22    defaults:
23      run:
24        shell: msys2 {0}
25    steps:
26    - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v3
27    - uses: msys2/setup-msys2@d44ca8e88d8b43d56cf5670f91747359d5537f97 # tag=v2.26.0
28      with:
29        msystem: ${{ matrix.msystem }}
30        install: make zlib git p7zip mingw-w64-${{matrix.env}}-gcc
31        update: true
32
33    - name: display versions
34      run: |
35        make -v
36        cc -v
37
38    - name: Building zlib to static link
39      run: |
40        git clone --depth 1 --branch v1.2.11 https://github.com/madler/zlib
41        make -C zlib -f win32/Makefile.gcc libz.a
42
43    - name: Building zstd programs
44      run: |
45        CPPFLAGS=-I../zlib LDFLAGS=../zlib/libz.a make -j allzstd MOREFLAGS=-static V=1
46
47    - name: Create artifacts
48      run: |
49        ./lib/dll/example/build_package.bat
50        mv bin/ zstd-${{ github.ref_name }}-${{matrix.ziparch}}/
51        7z a -tzip -mx9 zstd-${{ github.ref_name }}-${{matrix.ziparch}}.zip zstd-${{ github.ref_name }}-${{matrix.ziparch}}/
52        cd ..
53
54    - name: Publish zstd-$VERSION-${{matrix.ziparch}}.zip
55      uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # tag=v4.3.1
56      with:
57        path: ${{ github.workspace }}/zstd-${{ github.ref_name }}-${{matrix.ziparch}}.zip
58        name: zstd-${{ github.ref_name }}-${{matrix.ziparch}}.zip
59