Add support for re-encoding with Intel QSV #82
This file contains 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: "Package" | |
on: | |
push: | |
paths-ignore: | |
- "*.md" | |
- ".gitignore" | |
- "doc/**" | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
tarpkg: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Create version.txt | |
run: git describe --tags --match 'v*' >version.txt | |
- name: Create tarball | |
run: | | |
NAME=nb-dashcam-tools-$(git describe --tags --match 'v*' --abbrev=0 | cut -c2-) | |
tar -C "${{github.workspace}}" -czf "${{runner.temp}}/$NAME.tgz" \ | |
--exclude-vcs --transform "s,^\\.,$NAME," . | |
echo "$NAME.tgz" >"${{runner.temp}}/filename.txt" | |
- name: Upload tarball | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tarball | |
path: | | |
${{runner.temp}}/nb-dashcam-tools-*.tgz | |
${{runner.temp}}/filename.txt | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && (!env.ACT) | |
with: | |
files: "${{runner.temp}}/nb-dashcam-tools-*.tgz" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
winpkg: | |
runs-on: windows-2019 | |
needs: tarpkg | |
env: | |
qtver: "6.5.2" | |
steps: | |
- name: Setup MSVC command prompt | |
uses: ilammy/msvc-dev-cmd@v1 | |
- name: Download tarball | |
id: fetch | |
uses: actions/download-artifact@v3 | |
with: | |
name: tarball | |
path: ${{runner.temp}} | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v3 | |
with: | |
version: ${{env.qtver}} | |
setup-python: false | |
dir: "${{runner.temp}}/Qt" | |
cache: true | |
- name: Extract Archive | |
shell: cmd | |
run: | | |
set /p FILE=<${{runner.temp}}\filename.txt | |
"%SystemRoot%\System32\tar.exe" -C "${{github.workspace}}" -xf "${{runner.temp}}\%FILE%" --strip-components 1 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWIN_INSTALL_FFMPEG=ON -DWIN_CREATE_SETUP=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Install | |
run: cmake --install ${{github.workspace}}/build --prefix ${{github.workspace}}/deploy --config ${{env.BUILD_TYPE}} | |
- name: Upload package | |
if: ${{!env.ACT}} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: winpkg | |
path: ${{github.workspace}}/nb-dashcam-tools-setup.exe | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && (!env.ACT) | |
with: | |
files: ${{github.workspace}}/nb-dashcam-tools-setup.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
rpmpkg: | |
runs-on: ubuntu-latest | |
needs: tarpkg | |
strategy: | |
matrix: | |
tag: [38] | |
env: | |
DOCKER_BUILDKIT: '1' | |
steps: | |
- name: Download tarball | |
id: fetch | |
uses: actions/download-artifact@v3 | |
with: | |
name: tarball | |
path: ${{runner.temp}} | |
- name: Extract Archive | |
run: | | |
tar -C "${{github.workspace}}" \ | |
-xf "${{runner.temp}}/$(<${{runner.temp}}/filename.txt)" \ | |
--strip-components=1 | |
- name: Cache Docker Registry | |
id: cache-docker | |
uses: actions/cache@v3 | |
with: | |
path: "${{runner.temp}}/registry" | |
key: docker-registry-${{hashFiles('.github/docker/**')}}-${{secrets.cache_version}} | |
- name: Start Docker Registry | |
run: | | |
docker run -d -p 5000:5000 --restart=always --name registry \ | |
-v "${{runner.temp}}/registry:/var/lib/registry" registry:2 | |
npx wait-on tcp:5000 | |
- name: Build Docker Image | |
run: | | |
docker build -t fedora-rpm-build:${{matrix.tag}} \ | |
--build-arg tag=${{matrix.tag}} \ | |
--build-arg BUILDKIT_INLINE_CACHE=1 \ | |
--cache-from "localhost:5000/fedora-rpm-build:${{matrix.tag}}" \ | |
"${{github.workspace}}/.github/docker/rpmpkg" | |
- name: Push Docker Image | |
if: steps.cache-docker.outputs.cache-hit != 'true' | |
run: | | |
docker tag fedora-rpm-build:${{matrix.tag}} localhost:5000/fedora-rpm-build:${{matrix.tag}} | |
docker push localhost:5000/fedora-rpm-build:${{matrix.tag}} | |
- name: Create RPM | |
run: docker run --rm -v "${{runner.temp}}:/mnt" fedora-rpm-build:${{matrix.tag}} | |
- name: Upload package | |
if: ${{!env.ACT}} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: rpmpkg-${{matrix.tag}} | |
path: "${{runner.temp}}/nb-dashcam-tools-*.rpm" | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') && (!env.ACT) | |
with: | |
files: "${{runner.temp}}/nb-dashcam-tools-*.rpm" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |