actions: Add workflow for snap build #82
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Snap Build | |
| on: [push, pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Snap Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create snapcraft.yaml | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y autoconf automake build-essential cmake git libnuma-dev libtool libtool-bin m4 make meson nasm ninja-build patch pkg-config python3-yaml | |
| ./configure --launch-jobs=1 --snap --enable-qsv --enable-vce --enable-nvdec --enable-libdovi | |
| cd build | |
| make pkg.create.manifest.snap | |
| - name: Build HandBrake | |
| id: build | |
| uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 | |
| with: | |
| path: build/pkg | |
| - name: Build GStreamer Plugin | |
| id: build-gstreamer-plugin | |
| uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 | |
| with: | |
| path: build/pkg/gstreamer-plugin | |
| - name: Build Intel Media Plugin | |
| id: build-intel-media | |
| uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 | |
| with: | |
| path: build/pkg/intel-media | |
| - name: Upload Snaps | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: HandBrake | |
| path: | | |
| ${{ steps.build.outputs.snap }} | |
| ${{ steps.build-gstreamer-plugin.outputs.snap }} | |
| ${{ steps.build-intel-media.outputs.snap }} | |
| - name: Publish to Snapcraft | |
| uses: snapcore/action-publish@214b86e5ca036ead1668c79afb81e550e6c54d40 | |
| env: | |
| SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
| if: >- | |
| ${{ env.SNAPCRAFT_STORE_CREDENTIALS && | |
| (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') }} | |
| with: | |
| snap: ${{ steps.build.outputs.snap }} | |
| release: ${{ startsWith(github.ref, 'refs/tags') && 'beta' || 'edge' }} |