File: build.yml

package info (click to toggle)
qdl 2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 376 kB
  • sloc: ansic: 5,016; makefile: 87; xml: 75; sh: 70
file content (176 lines) | stat: -rw-r--r-- 4,614 bytes parent folder | download | duplicates (4)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Buildtest

on:
  pull_request:
  push:

jobs:
  build-linux:
    strategy:
      fail-fast: false
      matrix:
        include:
          - { arch: x64, os: 24, runner: ubuntu-24.04 }
          - { arch: arm64, os: 24, runner: ubuntu-24.04-arm }
          - { arch: x64, os: 22, runner: ubuntu-22.04 }
          - { arch: arm64, os: 22, runner: ubuntu-22.04-arm }
    runs-on: ${{ matrix.runner }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y libxml2-dev libusb-1.0-0-dev help2man

      - name: Build
        run: make

      - name: Run tests
        run: make tests

      - name: Generate man pages
        run: make manpages

      - name: Package
        run: |
          mkdir dist
          cp `pkg-config --variable=libdir libusb-1.0`/libusb-1.0.so.0 dist
          chmod 0644 dist/*
          cp qdl dist
          patchelf --set-rpath '$ORIGIN' dist/qdl

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: qdl-binary-ubuntu-${{matrix.os}}-${{ matrix.arch }}
          path: dist/*


  build-mac:
    strategy:
      fail-fast: false
      matrix:
        include:
          - { sys: macos-14, arch: arm64 }
          - { sys: macos-15-intel, arch: intel }
    runs-on: ${{ matrix.sys }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Dependencies
        run: |
          brew install libxml2 help2man

      - name: Build
        run: make

      - name: Generate man pages
        run: make manpages

      - name: Run tests
        run: make tests

      - name: Package
        run: |
          set -x
          mkdir dist
          cp `pkg-config --variable=libdir libusb-1.0`/libusb-1.0.0.dylib dist
          cp `pkg-config --variable=libdir liblzma`/liblzma.5.dylib dist
          chmod 0644 dist/*
          cp qdl dist

          if uname -a | grep -q arm64; then
            LIBUSB_DIR=/opt/homebrew/opt/libusb/lib
            LIBLZMA_DIR=/usr/lib
          else
            LIBUSB_DIR=/usr/local/opt/libusb/lib
            LIBLZMA_DIR=/usr/local/opt/xz/lib
          fi

          install_name_tool -add_rpath @executable_path dist/qdl
          install_name_tool -change $LIBUSB_DIR/libusb-1.0.0.dylib @rpath/libusb-1.0.0.dylib dist/qdl
          install_name_tool -change $LIBLZMA_DIR/liblzma.5.dylib @rpath/liblzma.5.dylib dist/qdl
          otool -L dist/qdl
          dist/qdl || true

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: qdl-binary-macos-${{ matrix.arch }}
          path: dist/*

  build-windows:
    strategy:
      fail-fast: false
      matrix:
        include:
          - { sys: windows-latest, arch: x64 }
          - { sys: windows-11-arm, arch: arm64 }
    runs-on: ${{ matrix.sys }}

    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup MSYS2
        id: msys2
        uses: msys2/setup-msys2@v2
        with:
          msystem: MINGW64
          install: >
            base-devel
            git
            help2man
            mingw-w64-x86_64-gcc
            mingw-w64-x86_64-make
            mingw-w64-x86_64-pkg-config
            mingw-w64-x86_64-libxml2
            mingw-w64-x86_64-libusb
            mingw-w64-x86_64-xz

      - name: Build
        run: |
          git config --global core.autocrlf true
          make
        shell: msys2 {0}

      - name: Generate man pages
        run: make manpages
        shell: msys2 {0}

      - name: Run tests
        run: make tests
        shell: msys2 {0}

      - name: Package
        shell: pwsh
        run: |
          $MSYS2_LOCATION = "${{ steps.msys2.outputs.msys2-location }}"
          $BIN_DIR = Join-Path $MSYS2_LOCATION "mingw64\bin"
          $DistDir = "dist"
          New-Item -ItemType Directory -Path $DistDir | Out-Null

          Copy-Item (Join-Path $BIN_DIR "zlib1.dll") $DistDir
          Copy-Item (Join-Path $BIN_DIR "libxml2-16.dll") $DistDir
          Copy-Item (Join-Path $BIN_DIR "libusb-1.0.dll") $DistDir
          Copy-Item (Join-Path $BIN_DIR "liblzma-5.dll") $DistDir
          Copy-Item (Join-Path $BIN_DIR "libiconv-2.dll") $DistDir

          Copy-Item "qdl.exe" $DistDir

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: qdl-binary-windows-${{ matrix.arch }}
          path: dist/*