File: build-pd-externals.yml

package info (click to toggle)
pd-pmpd 0.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,496 kB
  • sloc: ansic: 30,836; makefile: 31; sh: 6
file content (247 lines) | stat: -rw-r--r-- 8,394 bytes parent folder | download
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
name: Build Pure-Data externals

on: [push, pull_request]

env:
  PD_VERSION: 0.54-1

jobs:
  build_linux:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        arch: [amd64, arm64]
        floatsize: [32, 64]
    steps:
    - uses: actions/checkout@v4

    - name: Clone Pure Data
      run: git clone --branch=${PD_VERSION} --depth=1 https://github.com/pure-data/pure-data.git

    - name: Install Dependencies
      run: |
        sudo apt-get update -yqq
        sudo apt-get install -yqq ninja-build cmake --fix-missing

    - name: Prepare Cross-Compilation for arm64
      if: matrix.arch == 'arm64'
      run: |
        sudo apt install gcc-aarch64-linux-gnu -y
        echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

    - name: Build
      run: |
        cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DPUREDATA_ARCH_SUFFIX=${{ matrix.arch }} -DPUREDATA_FLOATSIZE=${{ matrix.floatsize }}
        cmake --build build --target install

    - name: Archive Package
      uses: actions/upload-artifact@v4
      with:
        name: pmpd-linux-${{ matrix.arch }}-pd${{ matrix.floatsize }}
        path: build/package/pmpd

  build_linux_arm7:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v4

    - name: Clone Pure Data
      run: git clone --branch=${PD_VERSION} --depth=1 https://github.com/pure-data/pure-data.git

    - name: Install Dependencies
      run: |
        sudo apt-get update
        DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq git build-essential cmake gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf ninja-build puredata

    - name: Build (Single Precision)
      run: ./cross_compile_rpi.sh

    - name: Archive Package
      uses: actions/upload-artifact@v4
      with:
        name: pmpd-linux-arm7-pd32
        path: build/package/pmpd

  build_macos_universal:
    runs-on: macos-latest
    strategy:
      matrix:
        floatsize: [32, 64]
    steps:
    - uses: actions/checkout@v4

    - name: Clone Pure Data
      run: git clone --branch=${PD_VERSION} --depth=1 https://github.com/pure-data/pure-data.git

    - name: Install Dependencies
      run: |
        brew update
        if brew list cmake &>/dev/null; then
          echo "cmake is already installed."
        else
          echo "Installing cmake..."
          brew install --formula cmake
        fi

    - name: Build for amd64 and arm64
      run: |
        cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.14" -DPUREDATA_FLOATSIZE=${{ matrix.floatsize }}
        cmake --build build --target install

    - name: Archive Package
      uses: actions/upload-artifact@v4
      with:
        name: pmpd-macos-universal-pd${{ matrix.floatsize }}
        path: build/package/pmpd

  build_windows_amd64:
    runs-on: windows-latest
    strategy:
      matrix:
        floatsize: [32, 64]
    steps:
    - uses: actions/checkout@v4

    - name: Download Pure Data Binaries
      shell: pwsh
      run: |
        if (${{ matrix.floatsize }} -eq 32) {
          Invoke-WebRequest -Uri "http://msp.ucsd.edu/Software/pd-$env:PD_VERSION.msw.zip" -OutFile "pd${{ matrix.floatsize }}-$env:PD_VERSION.msw.zip"
        } else {
          Invoke-WebRequest -Uri "https://puredata.info/downloads/pure-data/releases/$env:PD_VERSION-pd64/Pd64-$env:PD_VERSION.msw.zip" -OutFile "pd${{ matrix.floatsize }}-$env:PD_VERSION.msw.zip"
        }
        Expand-Archive -Path "pd${{ matrix.floatsize }}-$env:PD_VERSION.msw.zip" -DestinationPath .

    - name: Build
      shell: pwsh
      run: |
        if (${{ matrix.floatsize }} -eq 32) {
          cmake -S . -B build -DPUREDATA_INCLUDE_DIRS="pd-$env:PD_VERSION/src" -DPUREDATA_LIB="pd-$env:PD_VERSION/bin/pd.lib" -G "Visual Studio 17 2022" -A x64 -DPUREDATA_FLOATSIZE=${{ matrix.floatsize }}
        } else {
          $pd64_version = $env:PD_VERSION -replace '-', '.'
          cmake -S . -B build -DPUREDATA_INCLUDE_DIRS="Pd-$pd64_version/src" -DPUREDATA_LIB="Pd-$pd64_version/bin/pd64.lib" -G "Visual Studio 17 2022" -A x64 -DPUREDATA_FLOATSIZE=${{ matrix.floatsize }}
        }
        cmake --build build --config Release --target install

    - name: Archive Package
      uses: actions/upload-artifact@v4
      with:
        name: pmpd-windows-amd64-pd${{ matrix.floatsize }}
        path: build/package/pmpd

  build_windows_i386:
    runs-on: windows-latest
    steps:
    - uses: actions/checkout@v4

    - name: Download Pure Data Binaries
      run: |
        Invoke-WebRequest -Uri "http://msp.ucsd.edu/Software/pd-$env:PD_VERSION-i386.msw.zip" -OutFile "pd-$env:PD_VERSION-i386.msw.zip"
        Expand-Archive -Path "pd-$env:PD_VERSION-i386.msw.zip" -DestinationPath .

    - name: Build (Single Precision)
      run: |
        cmake -S . -B build -DPUREDATA_INCLUDE_DIRS="pd-$env:PD_VERSION-i386/src" -DPUREDATA_LIB="pd-$env:PD_VERSION-i386/bin/pd.lib" -G "Visual Studio 17 2022" -A Win32
        cmake --build build --config Release --target install

    - name: Archive Package
      uses: actions/upload-artifact@v4
      with:
        name: pmpd-windows-i386-pd32
        path: build/package/pmpd

  package_and_release:
    runs-on: ubuntu-latest
    needs: [build_linux, build_linux_arm7, build_macos_universal, build_windows_i386, build_windows_amd64]
    strategy:
      matrix:
        os: [linux, macos, windows]
    steps:
      - uses: actions/download-artifact@v4
        with:
          path: artifacts

      - name: Merge Artifacts to Package
        run: |
          mkdir -p pmpd
          cp -rn artifacts/pmpd-${{ matrix.os }}*/* pmpd

      - name: Upload Package
        uses: actions/upload-artifact@v4
        with:
          name: pmpd-${{ matrix.os }}
          path: pmpd

      - name: Create Zip for Release
        if: startsWith(github.ref, 'refs/tags/v')
        run: zip -r pmpd-${{ matrix.os }}.zip pmpd

      - name: Add Zip to Release
        if: startsWith(github.ref, 'refs/tags/v')
        uses: softprops/action-gh-release@v2
        with:
          files: pmpd-${{ matrix.os }}.zip

  deken_check_and_upload:
    runs-on: ubuntu-latest
    needs: [package_and_release]
    if: startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/checkout@v4
        with:
          path: pmpd-src

      - uses: actions/download-artifact@v4
        with:
          name: pmpd-windows
          path: pmpd-windows

      - uses: actions/download-artifact@v4
        with:
          name: pmpd-macos
          path: pmpd-macos

      - uses: actions/download-artifact@v4
        with:
          name: pmpd-linux
          path: pmpd-linux

      - name: Check Deken Package
        shell: bash
        run: |
          SHORT=${GITHUB_REF:11}
          SLUG=${SHORT//\//_}
          for os in linux macos windows; do
            echo "## ${os}" | tee -a $GITHUB_STEP_SUMMARY
            mkdir -p package-${os}
            docker run --rm --user $(id -u) --volume ./pmpd-${os}:/pmpd \
              --volume ./package-${os}:/package registry.git.iem.at/pd/deken \
              deken package --output-dir /package -v "${SLUG}" /pmpd

            dek_files=$(ls package-${os}/*.dek)
            for dek_file in $dek_files; do
              filename=$(basename "$dek_file")
              echo -e "#### \`$filename\`" | tee -a $GITHUB_STEP_SUMMARY
              echo '```' | tee -a $GITHUB_STEP_SUMMARY
              unzip -l "$dek_file" | awk 'NR>3 {print $4}' | sed '/^$/d' | sort | tee -a $GITHUB_STEP_SUMMARY
              echo '```' | tee -a $GITHUB_STEP_SUMMARY
            done
          done

      - name: Upload Deken Package
        if: ${{ !contains(github.ref, 'test') }} # upload if not a "test" release
        shell: bash
        env:
          DEKEN_USERNAME: ${{ secrets.DEKEN_USERNAME }}
          DEKEN_PASSWORD: ${{ secrets.DEKEN_PASSWORD }}
        run: |
          SHORT=${GITHUB_REF:11}
          SLUG=${SHORT//\//_}
          for os in linux macos windows; do
            docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
              --volume ./pmpd-${os}:/pmpd registry.git.iem.at/pd/deken \
              deken upload --no-source-error -v "${SLUG}" /pmpd
          done
          docker run --rm -e DEKEN_USERNAME -e DEKEN_PASSWORD \
            --volume ./pmpd-src:/pmpd registry.git.iem.at/pd/deken \
            deken upload -v "${SLUG}" /pmpd