Skip to content

Commit 04cdcaf

Browse files
author
Florian Asche
committed
Cleanup
1 parent 095ef6d commit 04cdcaf

File tree

6 files changed

+141
-13
lines changed

6 files changed

+141
-13
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
name: Build and publish the snapcast docker image
3+
4+
on:
5+
push:
6+
branches:
7+
- "main"
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
id-token: write
19+
attestations: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Extract clean branch name
26+
id: extract_branch
27+
run: echo "CLEAN_BRANCH_NAME=$(echo ${{ github.head_ref || github.ref_name }} | sed 's|.*/||')" >> $GITHUB_ENV
28+
29+
- name: Read version from file
30+
id: version
31+
run: echo "SNAPCAST_FULL_VERSION=$(cat version.txt)" >> $GITHUB_ENV
32+
33+
- name: Use version
34+
run: echo "The version is $SNAPCAST_FULL_VERSION"
35+
36+
- name: Compute build arguments
37+
id: compute_args
38+
run: |
39+
UPSTREAM_TAG="${SNAPCAST_FULL_VERSION%-*}"
40+
SNAPCAST_VERSION1="${UPSTREAM_TAG#v}"
41+
SNAPCAST_VERSION2="${SNAPCAST_FULL_VERSION#v}"
42+
for VAR in SNAPCAST_FULL_VERSION SNAPCAST_VERSION1 SNAPCAST_VERSION2; do
43+
echo "${VAR}=${!VAR}" >> $GITHUB_OUTPUT
44+
done
45+
46+
- name: Log in to the Container registry
47+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
48+
with:
49+
registry: ${{ env.REGISTRY }}
50+
username: ${{ github.actor }}
51+
password: ${{ github.token }}
52+
# Build Docker Images (amd64 and arm64)
53+
- name: Set up QEMU
54+
uses: docker/setup-qemu-action@v3
55+
- name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v3
57+
- name: Extract metadata for Docker
58+
id: meta
59+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
60+
with:
61+
images: ${{ env.REGISTRY }}/${{ github.repository }}
62+
# E.g. tag v1.2.0 produces 3 tags: '1.2.0', '1.2', and 'latest'
63+
# https://github.com/docker/metadata-action?tab=readme-ov-file#semver
64+
tags: |
65+
type=semver,pattern={{version}}
66+
- name: Build and push Docker image
67+
id: push
68+
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
69+
with:
70+
context: .
71+
platforms: linux/amd64,linux/aarch64
72+
push: true
73+
tags: |
74+
${{ env.REGISTRY }}/${{ github.repository }}:${{ env.CLEAN_BRANCH_NAME }}
75+
labels: |
76+
branch=${{ env.CLEAN_BRANCH_NAME }}
77+
build-args: |
78+
DEBIAN_VERSION=bookworm
79+
SNAPCAST_VERSION1=${{ steps.compute_args.outputs.SNAPCAST_VERSION1 }}
80+
SNAPCAST_VERSION2=${{ steps.compute_args.outputs.SNAPCAST_VERSION2 }}
81+
- name: Generate artifact attestation
82+
uses: actions/attest-build-provenance@v1
83+
with:
84+
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}
85+
subject-digest: ${{ steps.push.outputs.digest }}
86+
push-to-registry: true
87+

.github/workflows/docker-build-nightly.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Build and publish the nightly snapcast docker image
2+
name: Build and publish the snapcast docker image
33

44
on:
55
push:
@@ -78,4 +78,3 @@ jobs:
7878
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}
7979
subject-digest: ${{ steps.push.outputs.digest }}
8080
push-to-registry: true
81-
...

.github/workflows/docker-build-release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,3 @@ jobs:
7979
subject-name: ${{ env.REGISTRY }}/${{ github.repository }}
8080
subject-digest: ${{ steps.push.outputs.digest }}
8181
push-to-registry: true
82-
...

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# Default parameters
12
ARG DEBIAN_VERSION=bookworm
2-
ARG SNAPCAST_VERSION1=0.29.0
3-
ARG SNAPCAST_VERSION2=0.29.0-1
3+
#ARG SNAPCAST_VERSION1=0.31.0
4+
#ARG SNAPCAST_VERSION2=0.31.0-1
45

56
FROM debian:${DEBIAN_VERSION}
67
ARG DEBIAN_VERSION

README.md

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,57 @@
11
# docker-snapcast
2-
Docker image for the [Snapcast](https://github.com/badaix/snapcast) server and client programs. This repository is independent form the original Snapcast project.
32

4-
You can run the image as follows:
3+
This repository provides Docker images for [Snapcast](https://github.com/badaix/snapcast), a multi-room audio streaming solution. The images include both the Snapcast server and client components, allowing you to set up a synchronized audio streaming system across multiple devices.
4+
5+
## Features
6+
7+
- Pre-built Docker images for both Snapcast server and client
8+
- Uses Pipewire-client for audio server connectivity (If you need a Pi-Ready Image, you can find it here: https://github.com/florian-asche/PiCompose)
9+
- Supports multiple architectures
10+
- Automated builds with artifact attestation for security
11+
12+
## Usage
13+
14+
### Snapcast Server
15+
16+
To run the Snapcast server:
17+
18+
```bash
19+
docker run --rm -it ghcr.io/florian-asche/docker-snapcast:0.31.0-1
520
```
6-
### snapserver is the default process, and may be run as follows for example:
7-
docker run --rm -it ghcr.io/florian-asche/snapcast:0.28.0-0
821

9-
### If you'd like to run it in snapclient mode, you can run the container as follows:
10-
docker run --rm -it --entrypoint=/usr/bin/snapclient ghcr.io/florian-asche/snapcast:0.28.0-0 --hostID client1
22+
### Snapcast Client
23+
24+
To run the Snapcast client, specify the host ID and use the snapclient entrypoint:
25+
26+
```bash
27+
docker run --rm -it --entrypoint=/usr/bin/snapclient ghcr.io/florian-asche/docker-snapcast:0.31.0-1 --hostID client1
1128
```
1229

30+
## Build Information
31+
1332
Image builds can be tracked in this repository's `Actions` tab, and utilize [artifact attestation](https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds) to certify provenance.
1433

15-
The image uses pipewire for the connect to the audio server.
34+
The Docker images are built using GitHub Actions, which provides:
35+
- Automated builds for different architectures
36+
- Artifact attestation for build provenance verification
37+
- Regular updates and maintenance
38+
39+
### Available Tags
40+
41+
- `latest`: Latest stable release
42+
- `nightly`: Builds from the main branch (may be unstable)
43+
- Version-specific tags (e.g., `0.31.0-1`): Stable releases
44+
45+
### Build Process
46+
47+
The build process includes:
48+
- Multi-architecture support
49+
- Security verification through artifact attestation
50+
- Automated testing and validation
51+
- Regular updates to maintain compatibility
52+
53+
For more information about the build process and available architectures, please refer to the Actions tab in this repository.
54+
55+
#### Architecture
56+
57+
The Image is build for linux/amd64 and linux/aarch64

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.29.0-1
1+
0.31.0-1

0 commit comments

Comments
 (0)