|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + types: [opened, synchronize, reopened] |
| 7 | + release: |
| 8 | + types: [published] |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: write # needed for release upload |
| 12 | + |
| 13 | +jobs: |
| 14 | + build: |
| 15 | + name: Build fooyin and plugin |
| 16 | + runs-on: ubuntu-latest |
| 17 | + container: archlinux:latest |
| 18 | + |
| 19 | + env: |
| 20 | + FOOYIN_REF: master |
| 21 | + FOOYIN_PREFIX: ${{ github.workspace }}/fooyin-install |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Dependencies |
| 25 | + run: | |
| 26 | + pacman -Syu --noconfirm --needed \ |
| 27 | + alsa-lib \ |
| 28 | + base-devel \ |
| 29 | + cmake \ |
| 30 | + ffmpeg \ |
| 31 | + git \ |
| 32 | + icu \ |
| 33 | + ninja \ |
| 34 | + qt6-base \ |
| 35 | + qt6-svg \ |
| 36 | + qt6-tools \ |
| 37 | + taglib \ |
| 38 | + zlib |
| 39 | +
|
| 40 | + - name: Checkout plugin |
| 41 | + uses: actions/checkout@v7 |
| 42 | + with: |
| 43 | + submodules: recursive |
| 44 | + |
| 45 | + - name: Checkout fooyin |
| 46 | + uses: actions/checkout@v7 |
| 47 | + with: |
| 48 | + repository: fooyin/fooyin |
| 49 | + ref: ${{ env.FOOYIN_REF }} |
| 50 | + path: fooyin |
| 51 | + submodules: recursive |
| 52 | + |
| 53 | + - name: Configure fooyin |
| 54 | + run: | |
| 55 | + cmake -S fooyin -B fooyin-build -G Ninja \ |
| 56 | + -DCMAKE_BUILD_TYPE=Release \ |
| 57 | + -DCMAKE_INSTALL_PREFIX="$FOOYIN_PREFIX" \ |
| 58 | + -DBUILD_PCH=ON \ |
| 59 | + -DBUILD_TRANSLATIONS=OFF \ |
| 60 | + -DINSTALL_HEADERS=ON \ |
| 61 | + -DPLUGIN_SELECTION=none |
| 62 | +
|
| 63 | + - name: Build fooyin |
| 64 | + run: cmake --build fooyin-build |
| 65 | + |
| 66 | + - name: Install fooyin |
| 67 | + run: cmake --install fooyin-build |
| 68 | + |
| 69 | + - name: Configure plugin |
| 70 | + run: | |
| 71 | + cmake -S . -B build -G Ninja \ |
| 72 | + -DCMAKE_BUILD_TYPE=Release \ |
| 73 | + -DCMAKE_PREFIX_PATH="$FOOYIN_PREFIX" |
| 74 | +
|
| 75 | + - name: Build plugin |
| 76 | + run: cmake --build build |
| 77 | + |
| 78 | + - name: Upload artifact |
| 79 | + uses: actions/upload-artifact@v6 |
| 80 | + with: |
| 81 | + name: fooyin-plugin-vgmstream |
| 82 | + path: build/fyplugin_vgmstream.so |
| 83 | + if-no-files-found: error |
| 84 | + |
| 85 | + attach: |
| 86 | + name: Attach to release |
| 87 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 88 | + runs-on: ubuntu-latest |
| 89 | + needs: build |
| 90 | + steps: |
| 91 | + - name: Download artifact |
| 92 | + uses: actions/download-artifact@v7 |
| 93 | + with: |
| 94 | + name: fooyin-plugin-vgmstream |
| 95 | + path: ./artifacts |
| 96 | + |
| 97 | + - name: Upload artifact to release |
| 98 | + uses: svenstaro/upload-release-action@v2 |
| 99 | + with: |
| 100 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 101 | + tag: ${{ github.event.release.tag_name }} |
| 102 | + file: ./artifacts/fyplugin_vgmstream.so |
| 103 | + overwrite: true |
0 commit comments