From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 15 Jul 2021 11:39:56 +0000 (+0100) Subject: Updates from public SPS repo. X-Git-Tag: 4.1-dev~5^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3265f08840412a6b1c2ea59b1dff5b7357e3fd58;p=thirdparty%2Fshairport-sync.git Updates from public SPS repo. --- diff --git a/.github/workflows/docker-build-releases.yaml b/.github/workflows/docker-build-releases.yaml index 80e6d263..ef355fa8 100644 --- a/.github/workflows/docker-build-releases.yaml +++ b/.github/workflows/docker-build-releases.yaml @@ -8,8 +8,11 @@ name: Build and push docker images on releases. on: release: - types: [ published ] + types: [ ] +env: + DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + jobs: main: runs-on: ubuntu-latest @@ -22,11 +25,14 @@ jobs: - name: Set SHAIRPORT_SYNC_BRANCH env. run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - - name: Set up ssh agent - uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos. - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - + - name: Determine NQPTP env (part 1). + if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }} + run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV + + - name: Determine NQPTP env (part 2). + if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }} + run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -36,7 +42,7 @@ jobs: - name: Login to Docker Registry uses: docker/login-action@v1 with: - registry: registry.nova.do + registry: ${{ secrets.DOCKER_REGISTRY }} username: ${{ secrets.DOCKER_REGISTRY_USER }} password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} @@ -45,20 +51,20 @@ jobs: with: context: ./ file: ./docker/Dockerfile - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + platforms: ${{ env.PLATFORMS }} push: true - tags: registry.nova.do/shairport-sync:latest registry.nova.do/shairport-sync:${{ github.event.release.tag_name }} + tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }} build-args: | SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} - ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos. + NQPTP_BRANCH=${{ env.NQPTP_BRANCH }} - name: Build and push (AirPlay 1) uses: docker/build-push-action@v2 with: context: ./ file: ./docker/airplay1/Dockerfile-AirPlay1 - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + platforms: ${{ env.PLATFORMS }} push: true - tags: registry.nova.do/shairport-sync:latest-airplay1, registry.nova.do/shairport-sync:${{ github.event.release.tag_name }}-airplay1 + tags: ${{ secrets.DOCKER_IMAGE_NAME }}:latest-airplay1, ${{ secrets.DOCKER_IMAGE_NAME }}:${{ github.event.release.tag_name }}-airplay1 build-args: | SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} \ No newline at end of file diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index a5a5f68c..27cb0342 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -1,5 +1,5 @@ # Builds & pushes a docker image when a commit is made to one of the branches specified below. -# Tag pattern: 'unstable-[BRANCH NAME]'. +# Tag pattern: 'unstable-[BRANCH NAME]' & 'unstable-[BRANCH NAME]-airplay1' # See docker-build-releases.yaml for release build process. name: Build and push docker image based on commit to specified branches. @@ -7,6 +7,9 @@ name: Build and push docker image based on commit to specified branches. on: push: branches: [ master, development, charles-dev ] + +env: + DOCKER_PLATFORMS: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 jobs: main: @@ -20,11 +23,14 @@ jobs: - name: Set SHAIRPORT_SYNC_BRANCH env. run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - - name: Set up ssh agent - uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos. - with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - + - name: Determine NQPTP env (part 1). + if: ${{ env.SHAIRPORT_SYNC_BRANCH == 'development' }} + run: echo "NQPTP_BRANCH=development" >> $GITHUB_ENV + + - name: Determine NQPTP env (part 2). + if: ${{ env.SHAIRPORT_SYNC_BRANCH != 'development' }} + run: echo "NQPTP_BRANCH=master" >> $GITHUB_ENV + - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -34,7 +40,7 @@ jobs: - name: Login to Docker Registry uses: docker/login-action@v1 with: - registry: registry.nova.do + registry: ${{ secrets.DOCKER_REGISTRY }} username: ${{ secrets.DOCKER_REGISTRY_USER }} password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} @@ -43,20 +49,20 @@ jobs: with: context: ./ file: ./docker/Dockerfile - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + platforms: ${{ env.DOCKER_PLATFORMS }} push: true - tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }} + tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }} build-args: | SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} - ssh: default=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos. + NQPTP_BRANCH=${{ env.NQPTP_BRANCH }} - name: Build and push (AirPlay 1) uses: docker/build-push-action@v2 with: context: ./ file: ./docker/airplay1/Dockerfile - platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 + platforms: ${{ env.DOCKER_PLATFORMS }} push: true - tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1 + tags: ${{ secrets.DOCKER_IMAGE_NAME }}:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }}-airplay1 build-args: | SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 1203b1c6..98a3900c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -43,22 +43,21 @@ RUN make install # Shairport Sync Build System: FROM builder-base AS builder-sps -# This will be modified by the Github Action Workflow and is required -# to ensure the correct branch is being used. +# These will be modified by the Github Action Workflow and are required +# to ensure the correct branches are being used. ARG SHAIRPORT_SYNC_BRANCH RUN test -n "$SHAIRPORT_SYNC_BRANCH" +ARG NQPTP_BRANCH +RUN test -n "$NQPTP_BRANCH" COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/ COPY --from=builder-alac /usr/local/lib/pkgconfig/alac.pc /usr/local/lib/pkgconfig/alac.pc COPY --from=builder-alac /usr/local/include /usr/local/include -# TODO: Remove when no longer pulling from private repos. -RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts - -RUN --mount=type=ssh git clone git@github.com:mikebrady/nqptp.git +RUN git clone https://github.com/mikebrady/nqptp WORKDIR /nqptp # Use development branch for now. -RUN git checkout development +RUN git checkout "$NQPTP_BRANCH" RUN autoreconf -fi RUN ./configure RUN make diff --git a/docker/README.md b/docker/README.md index ccb691a2..6043cc44 100644 --- a/docker/README.md +++ b/docker/README.md @@ -28,12 +28,20 @@ Edit the configuration file `/etc/shairport-sync.conf` in the container (or use ## Build Example (for arm7 devices) -TODO: remove `--ssh` when going public as this is only for private repos. ``` -docker buildx build --ssh default=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development -t registry.nova.do/shairport-sync:unstable-development . +docker buildx build --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=development --build-arg NQPTP_BRANCH=development -t shairport-sync:unstable-development . ``` `SHAIRPORT_SYNC_BRANCH` is required to ensure the image is built using the expected branch. ## AirPlay 1 Only -The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container. \ No newline at end of file + +The AirPlay1 only dockerfile is in the `airplay1` folder. This also includes the `start.sh` script used by the container. Please note that the AirPlay 1 image build via the AirPlay 2 branch does not work with multiple instances on the same hardware. + +## GitHub Action Builds + +Requires the following secrets to be set in the repo: +- `DOCKER_REGISTRY` - docker.io if using Docker Hub, else set to your registry URL. +- `DOCKER_REGISTRY_TOKEN` - Access token for your registry. +- `DOCKER_REGISTRY_USER` - Login user for your registry. +- `DOCKER_IMAGE_NAME` - The name of the image, for example `your-registry.com/shairport-sync` or just `your-username/shairport-sync` if using Docker Hub. \ No newline at end of file diff --git a/docker/airplay1/README.md b/docker/airplay1/README.md index 247754e6..f8335d76 100644 --- a/docker/airplay1/README.md +++ b/docker/airplay1/README.md @@ -1,3 +1,3 @@ # AirPlay 1 Only Docker Image -See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags. For the latest build, use `latest-airplay1`. \ No newline at end of file +See the [Shairport Sync Docker Hub Repo](https://hub.docker.com/r/mikebrady/shairport-sync) for available tags. diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index abcce4bc..74ed09ac 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -2,7 +2,7 @@ services: shairport-sync: - image: registry.nova.do/shairport-sync:unstable-development + image: mikebrady/shairport-sync:unstable-development network_mode: host restart: unless-stopped devices: