summaryrefslogtreecommitdiffstats
path: root/.github/workflows/libzip.yml
blob: 3d1fac407addd5bdaad80d3fc14be4cf76f75062 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: build-libzip-static

on: workflow_dispatch

jobs:
  build-windows:
    runs-on: ${{ matrix.runner }}
    defaults:
      run:
        shell: msys2 {0}
    strategy:
      fail-fast: false
      matrix:
        include: [
          { runner: windows-latest, msystem: CLANG64, arch: x86_64, flavor: w64-clang, cc: clang },
          { runner: windows-latest, msystem: UCRT64, arch: x86_64, flavor: w64-ucrt, cc: gcc },
          { runner: windows-latest, msystem: MINGW64, arch: x86_64, flavor: w64, cc: gcc },
          { runner: windows-latest, msystem: MINGW32, arch: i686, flavor: w64, cc: gcc },
          { runner: windows-11-arm, msystem: CLANGARM64, arch: aarch64, flavor: w64-clang, cc: clang }
        ]
    steps:
    - uses: msys2/setup-msys2@v2
      with:
        msystem: ${{ matrix.msystem }}
        release: false
        update: false
        suppress-deprecation-warnings: msystem-mingw32 msystem-mingw64
        install: >-
          base-devel
          git
          mingw-${{ matrix.flavor }}-${{ matrix.arch }}-${{ matrix.cc }}
          make
          mingw-${{ matrix.flavor }}-${{ matrix.arch }}-cmake
          mingw-${{ matrix.flavor }}-${{ matrix.arch }}-bzip2
          mingw-${{ matrix.flavor }}-${{ matrix.arch }}-xz
          mingw-${{ matrix.flavor }}-${{ matrix.arch }}-zlib
    - name: prepare environment
      run: |
          dest=`echo ${{ matrix.msystem }} |tr [:upper:] [:lower:]`
          echo "dest=$dest" >> $GITHUB_ENV
          echo "target_triplet=`${{ matrix.cc }} -dumpmachine`" >> $GITHUB_ENV
    - name: fetch libzip source
      run: |
          curl -Ls -o libzip-1.12.1.tar.gz https://libzip.org/download/libzip-1.12.1.tar.gz
          tar xzf libzip-1.12.1.tar.gz
    - name: configure libzip
      run: |
          cd libzip-1.12.1
          mkdir -p dest
          instpath=`pwd`/dest
          echo "instpath=`pwd`/dest" >> $GITHUB_ENV
          mkdir build
          cd build
          cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH="$instpath" -DBUILD_SHARED_LIBS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLES=OFF -DBUILD_OSSFUZZ=OFF -DBUILD_REGRESS=OFF -DBUILD_TOOLS=OFF -DENABLE_GNUTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_ZSTD=OFF ..
    - name: build libzip
      run: |
          CURDIR=`pwd`
          cd libzip-1.12.1/build
          echo $CURDIR
          ls -l
          make
          make install
          tar cf $CURDIR/libzip-static.tar -C ${{ env.instpath }} .
    - name: publish artifact
      uses: actions/upload-artifact@v6
      with:
        name: libzip_${{ matrix.arch }}-windows-${{ env.dest }}
        path: libzip-static.tar