|
| 1 | +name: Debian packages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + release: |
| 9 | + types: |
| 10 | + - published |
| 11 | + - prereleased |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-pulse-amd64: |
| 15 | + runs-on: ubuntu-20.04 |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Update git |
| 19 | + run: | |
| 20 | + sudo apt update |
| 21 | + sudo apt upgrade -y git |
| 22 | + |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + ref: 'master' |
| 26 | + submodules: 'recursive' |
| 27 | + |
| 28 | + - name: Install dependencies (PulseAudio flavor) |
| 29 | + run: | |
| 30 | + sudo apt install -y lftp pkg-config qtbase5-private-dev qtbase5-dev libqt5svg5-dev libglibmm-2.4-dev libglib2.0-dev libpulse-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev |
| 31 | + |
| 32 | + - name: Initialize project (PulseAudio flavor) |
| 33 | + run: qmake JDSP4Linux.pro "CONFIG += CI" "CONFIG += USE_PULSEAUDIO" |
| 34 | + |
| 35 | + - name: Build |
| 36 | + run: | |
| 37 | + make |
| 38 | + |
| 39 | + - name: Upload artifacts |
| 40 | + uses: actions/upload-artifact@v2 |
| 41 | + with: |
| 42 | + name: jamesdsp-pulse_portable_linux64 |
| 43 | + path: src/jamesdsp |
| 44 | + |
| 45 | + build-pipewire-amd64: |
| 46 | + runs-on: ubuntu-20.04 |
| 47 | + container: ubuntu:21.04 |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Update git |
| 51 | + run: | |
| 52 | + apt update |
| 53 | + apt upgrade -y git |
| 54 | + |
| 55 | + - uses: actions/checkout@v2 |
| 56 | + with: |
| 57 | + ref: 'master' |
| 58 | + submodules: 'recursive' |
| 59 | + |
| 60 | + - name: Install dependencies (PipeWire flavor) |
| 61 | + run: | |
| 62 | + export PKG_CONFIG_PATH="/usr/lib/pkgconfig:$PATH" |
| 63 | + echo 'tzdata tzdata/Areas select Europe' | debconf-set-selections |
| 64 | + echo 'tzdata tzdata/Zones/Europe select Paris' | debconf-set-selections |
| 65 | + DEBIAN_FRONTEND="noninteractive" apt install -y tree make gcc g++ lftp pkg-config qtbase5-private-dev qtbase5-dev libqt5svg5-dev libglibmm-2.4-dev libglib2.0-dev libpipewire-0.3-dev |
| 66 | + |
| 67 | + - name: Initialize project (PipeWire flavor) |
| 68 | + run: qmake JDSP4Linux.pro "CONFIG += CI" |
| 69 | + |
| 70 | + - name: Build |
| 71 | + run: | |
| 72 | + make |
| 73 | + |
| 74 | + - name: Upload artifacts |
| 75 | + uses: actions/upload-artifact@v2 |
| 76 | + with: |
| 77 | + name: jamesdsp-pipewire_portable_linux64 |
| 78 | + path: src/jamesdsp |
| 79 | + |
| 80 | + build-deb-amd64: |
| 81 | + runs-on: ubuntu-20.04 |
| 82 | + needs: [build-pulse-amd64, build-pipewire-amd64] |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + flavor: [pulse, pipewire] |
| 86 | + |
| 87 | + steps: |
| 88 | + - uses: actions/checkout@v2 |
| 89 | + with: |
| 90 | + submodules: 'recursive' |
| 91 | + ref: 'master' |
| 92 | + |
| 93 | + - name: Prepare version information (1/3) |
| 94 | + uses: oprypin/find-latest-tag@v1 |
| 95 | + with: |
| 96 | + repository: Audio4Linux/JDSP4Linux |
| 97 | + releases-only: false |
| 98 | + id: last_release |
| 99 | + - name: Prepare version information (2/3) |
| 100 | + uses: benjlevesque/short-sha@v1.2 |
| 101 | + id: short-sha |
| 102 | + with: |
| 103 | + length: 6 |
| 104 | + - name: Prepare version information (3/3) |
| 105 | + run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' |
| 106 | + id: version |
| 107 | + |
| 108 | + - name: Download artifact |
| 109 | + uses: actions/download-artifact@v2 |
| 110 | + with: |
| 111 | + name: jamesdsp-${{ matrix.flavor }}_portable_linux64 |
| 112 | + |
| 113 | + - name: Build DEB package |
| 114 | + run: | |
| 115 | + chmod +x ./meta/build_deb_package.sh |
| 116 | + ./meta/build_deb_package.sh ${{steps.version.outputs.version}} ${{ matrix.flavor }} |
| 117 | + |
| 118 | + - name: Upload artifact |
| 119 | + uses: actions/upload-artifact@v2 |
| 120 | + with: |
| 121 | + name: jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb |
| 122 | + path: jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb |
| 123 | + |
| 124 | + publish-nightly: |
| 125 | + runs-on: ubuntu-latest |
| 126 | + needs: [build-deb-amd64] |
| 127 | + strategy: |
| 128 | + matrix: |
| 129 | + flavor: [pulse, pipewire] |
| 130 | + |
| 131 | + steps: |
| 132 | + - name: Prepare version information (1/3) |
| 133 | + uses: oprypin/find-latest-tag@v1 |
| 134 | + with: |
| 135 | + repository: Audio4Linux/JDSP4Linux |
| 136 | + releases-only: false |
| 137 | + id: last_release |
| 138 | + |
| 139 | + - name: Prepare version information (2/3) |
| 140 | + uses: benjlevesque/short-sha@v1.2 |
| 141 | + id: short-sha |
| 142 | + with: |
| 143 | + length: 6 |
| 144 | + - name: Prepare version information (3/3) |
| 145 | + run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' |
| 146 | + id: version |
| 147 | + |
| 148 | + - name: Download portable artifact |
| 149 | + uses: actions/download-artifact@v2 |
| 150 | + with: |
| 151 | + name: jamesdsp-${{ matrix.flavor }}_portable_linux64 |
| 152 | + |
| 153 | + - name: Download package artifact |
| 154 | + uses: actions/download-artifact@v2 |
| 155 | + with: |
| 156 | + name: jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb |
| 157 | + |
| 158 | + - name: Rename portable artifact |
| 159 | + run: mv jamesdsp jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_portable_linux64.bin |
| 160 | + |
| 161 | + - name: Upload binary to nightly server |
| 162 | + uses: wlixcc/SFTP-Deploy-Action@v1.0 |
| 163 | + with: |
| 164 | + username: 'tim' |
| 165 | + server: 'local.timschneeberger.me' |
| 166 | + port: 22 |
| 167 | + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 168 | + local_path: './jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_portable_linux64.bin' |
| 169 | + remote_path: '/srv/http/nightly.timschneeberger.me/jamesdsp-linux/' |
| 170 | + args: '-o ConnectTimeout=5' |
| 171 | + |
| 172 | + - name: Upload deb package to nightly server |
| 173 | + uses: wlixcc/SFTP-Deploy-Action@v1.0 |
| 174 | + with: |
| 175 | + username: 'tim' |
| 176 | + server: 'local.timschneeberger.me' |
| 177 | + port: 22 |
| 178 | + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} |
| 179 | + local_path: './jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb' |
| 180 | + remote_path: '/srv/http/nightly.timschneeberger.me/jamesdsp-linux/' |
| 181 | + args: '-o ConnectTimeout=5' |
| 182 | + |
| 183 | + update-ppa: |
| 184 | + if: github.event_name == 'release' |
| 185 | + runs-on: ubuntu-latest |
| 186 | + needs: [build-deb-amd64] |
| 187 | + strategy: |
| 188 | + matrix: |
| 189 | + flavor: [pulse, pipewire] |
| 190 | + max-parallel: 1 |
| 191 | + |
| 192 | + steps: |
| 193 | + - uses: actions/checkout@v2 |
| 194 | + with: |
| 195 | + repository: 'ThePBone/PPA-Repository' |
| 196 | + token: ${{ secrets.REPO_AUTH_TOKEN }} |
| 197 | + persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token |
| 198 | + fetch-depth: 0 |
| 199 | + |
| 200 | + - name: Prepare version information (1/3) |
| 201 | + uses: oprypin/find-latest-tag@v1 |
| 202 | + with: |
| 203 | + repository: Audio4Linux/JDSP4Linux |
| 204 | + releases-only: false |
| 205 | + id: last_release |
| 206 | + |
| 207 | + - name: Prepare version information (2/3) |
| 208 | + uses: benjlevesque/short-sha@v1.2 |
| 209 | + id: short-sha |
| 210 | + with: |
| 211 | + length: 6 |
| 212 | + - name: Prepare version information (3/3) |
| 213 | + run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' |
| 214 | + id: version |
| 215 | + |
| 216 | + - name: Download package artifact |
| 217 | + uses: actions/download-artifact@v2 |
| 218 | + with: |
| 219 | + name: jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb |
| 220 | + |
| 221 | + - name: Import GPG key |
| 222 | + id: import_gpg |
| 223 | + uses: crazy-max/ghaction-import-gpg@v4 |
| 224 | + with: |
| 225 | + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} |
| 226 | + |
| 227 | + - name: GPG user IDs |
| 228 | + run: | |
| 229 | + echo "fingerprint: ${{ steps.import_gpg.outputs.fingerprint }}" |
| 230 | + echo "keyid: ${{ steps.import_gpg.outputs.keyid }}" |
| 231 | + echo "name: ${{ steps.import_gpg.outputs.name }}" |
| 232 | + echo "email: ${{ steps.import_gpg.outputs.email }}" |
| 233 | +
|
| 234 | + - name: Update packages |
| 235 | + run: | |
| 236 | + sudo apt install dpkg-dev apt-utils |
| 237 | + export EMAIL="tim.schneeberger@outlook.de" |
| 238 | + dpkg-scanpackages --multiversion . > Packages |
| 239 | + gzip -k -f Packages |
| 240 | + apt-ftparchive release . > Release |
| 241 | + gpg --default-key "${EMAIL}" -abs -o - Release > Release.gpg |
| 242 | + gpg --default-key "${EMAIL}" --clearsign -o - Release > InRelease |
| 243 | +
|
| 244 | + - name: Commit |
| 245 | + run: | |
| 246 | + git config --local user.email "tim.schneeberger@outlook.de" |
| 247 | + git config --local user.name "Tim Schneeberger" |
| 248 | + git add . |
| 249 | + git commit -m "Update jamesdsp packages" |
| 250 | +
|
| 251 | + - name: Push changes |
| 252 | + uses: ad-m/github-push-action@master |
| 253 | + with: |
| 254 | + github_token: ${{ secrets.REPO_AUTH_TOKEN }} |
| 255 | + repository: ThePBone/PPA-Repository |
| 256 | + force: true |
| 257 | + |
| 258 | + attach-to-release: |
| 259 | + runs-on: ubuntu-latest |
| 260 | + needs: [build-deb-amd64] |
| 261 | + strategy: |
| 262 | + matrix: |
| 263 | + flavor: [pulse, pipewire] |
| 264 | + |
| 265 | + if: github.event_name == 'release' |
| 266 | + |
| 267 | + steps: |
| 268 | + - name: Prepare version information (1/3) |
| 269 | + uses: oprypin/find-latest-tag@v1 |
| 270 | + with: |
| 271 | + repository: Audio4Linux/JDSP4Linux |
| 272 | + releases-only: true |
| 273 | + id: last_release |
| 274 | + |
| 275 | + - name: Prepare version information (2/3) |
| 276 | + uses: benjlevesque/short-sha@v1.2 |
| 277 | + id: short-sha |
| 278 | + with: |
| 279 | + length: 6 |
| 280 | + - name: Prepare version information (3/3) |
| 281 | + run: echo '::set-output name=version::${{steps.last_release.outputs.tag}}-${{steps.short-sha.outputs.sha}}' |
| 282 | + id: version |
| 283 | + |
| 284 | + - name: Download package artifact |
| 285 | + uses: actions/download-artifact@v2 |
| 286 | + with: |
| 287 | + name: jamesdsp-${{ matrix.flavor }}_${{steps.version.outputs.version}}_linux64.deb |
| 288 | + |
| 289 | + - uses: AButler/upload-release-assets@v2.0 |
| 290 | + with: |
| 291 | + files: '*.deb' |
| 292 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments