648db22b |
1 | name: windows-artifacts |
2 | |
3 | on: |
4 | push: |
5 | branches: [ test_artifacts, win_artifacts ] |
6 | release: |
7 | types: |
8 | - published |
9 | |
10 | permissions: read-all |
11 | |
12 | jobs: |
f535537f |
13 | windows-artifacts: |
648db22b |
14 | # see https://ariya.io/2020/07/on-github-actions-with-msys2 |
15 | runs-on: windows-latest |
f535537f |
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 } |
648db22b |
22 | defaults: |
23 | run: |
24 | shell: msys2 {0} |
25 | steps: |
f535537f |
26 | - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # tag=v3 |
648db22b |
27 | - uses: msys2/setup-msys2@5beef6d11f48bba68b9eb503e3adc60b23c0cc36 # tag=v2 |
28 | with: |
f535537f |
29 | msystem: ${{ matrix.msystem }} |
30 | install: make zlib git p7zip mingw-w64-${{matrix.env}}-gcc |
648db22b |
31 | update: true |
f535537f |
32 | |
648db22b |
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 | |
f535537f |
43 | - name: Building zstd programs |
648db22b |
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 |
f535537f |
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}}/ |
648db22b |
52 | cd .. |
53 | |
f535537f |
54 | - name: Publish zstd-$VERSION-${{matrix.ziparch}}.zip |
55 | uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # tag=v4.3.1 |
648db22b |
56 | with: |
f535537f |
57 | path: ${{ github.workspace }}/zstd-${{ github.ref_name }}-${{matrix.ziparch}}.zip |
58 | name: zstd-${{ github.ref_name }}-${{matrix.ziparch}}.zip |