diff --git a/.github/ci/Dockerfile b/.github/ci/Dockerfile index 47e45de..d2bd1b3 100644 --- a/.github/ci/Dockerfile +++ b/.github/ci/Dockerfile @@ -31,10 +31,11 @@ FROM build as deb_make ARG GIT_VERSION ARG BUILD_TYPE="generic" ENV DEB_BUILD_PROFILES="$BUILD_TYPE" +ARG DEB_REVISION="1" RUN apt-get build-dep -y $PWD RUN . /etc/os-release && \ - export RELEASE_SUFFIX="$VERSION_CODENAME" && \ + export RELEASE_SUFFIX="$VERSION_CODENAME-$DEB_REVISION" && \ dpkg-buildpackage -us -uc -b RUN mkdir -p /deb && mv ../*.deb /deb/ diff --git a/.github/workflows/build_packages.yaml b/.github/workflows/build_packages.yaml new file mode 100644 index 0000000..42288d9 --- /dev/null +++ b/.github/workflows/build_packages.yaml @@ -0,0 +1,65 @@ +on: + workflow_dispatch: + inputs: + tag: + description: "camera-streamer tag to build" + required: true + default: '' + deb_revision: + description: "Revision to use for the debian packages" + required: false + default: '1' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + strategy: + matrix: + debian_version: [bullseye] + #docker_arch: [amd64, arm32v7, arm64v8] + docker_arch: [arm32v7] + #build_type: [generic, raspi] + build_type: [raspi] + exclude: + - docker_arch: amd64 + build_type: raspi + - debian_version: buster + build_type: raspi + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + ref: ${{ github.event.inputs.tag }} + - name: Set GIT_VERSION + run: echo "GIT_VERSION=$(git describe --tags)" >> $GITHUB_ENV + - name: Set DEB_REVISION + shell: bash + run: | + revision="${{ github.event.inputs.debian_revision }}" + if [[ -n "$revision" ]]; then + echo "DEB_REVISION=${revision}" >> $GITHUB_ENV + else + echo "DEB_REVISION=1" >> $GITHUB_ENV + fi + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Build Dockerfile + run: docker build --target deb_make --tag deb_make --file .github/ci/Dockerfile --build-arg GIT_VERSION --build-arg DEB_REVISION --build-arg DOCKER_ARCH --build-arg DEBIAN_VERSION --build-arg BUILD_TYPE . + env: + DEBIAN_VERSION: ${{ matrix.debian_version }} + DOCKER_ARCH: ${{ matrix.docker_arch }}/ + BUILD_TYPE: ${{ matrix.build_type }} + - name: Create container + run: docker create --name deb_make deb_make + - name: Copy files + run: 'docker cp deb_make:/deb/. deb/' + - name: 'Upload debian files' + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.debian_version }}-${{ matrix.docker_arch }}-${{ matrix.build_type }}.zip + path: deb/ + retention-days: 14