Skip to content

Commit 8a69719

Browse files
committed
fix: build for bullseye & bookworm
1 parent e63a7c5 commit 8a69719

File tree

4 files changed

+136
-84
lines changed

4 files changed

+136
-84
lines changed

.github/workflows/package.yml

Lines changed: 87 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
debian_revision:
77
description: "Debian revision to use"
88
required: false
9-
default: '1'
9+
default: "1"
1010

1111
jobs:
1212
package:
@@ -19,46 +19,50 @@ jobs:
1919
git-hash: ${{ steps.version.outputs.git-hash }}
2020

2121
steps:
22-
- name: "⬇ Checkout"
23-
uses: actions/checkout@v3
22+
- name: "⬇ Checkout"
23+
uses: actions/checkout@v3
2424

25-
- name: 🏗 Set up Python 3.10
26-
uses: actions/setup-python@v4
27-
with:
28-
python-version: "3.10"
25+
- name: 🏗 Set up Python 3.10
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.10"
2929

30-
- name: Install termux-create-package
31-
run: |
32-
export install_path="/usr/local/bin"
33-
sudo mkdir -p "$install_path"
34-
sudo curl -L 'https://github.com/termux/termux-create-package/releases/latest/download/termux-create-package' -o "$install_path/termux-create-package"
35-
sudo chmod 755 "$install_path/termux-create-package"
30+
- name: Install termux-create-package
31+
run: |
32+
export install_path="/usr/local/bin"
33+
sudo mkdir -p "$install_path"
34+
sudo curl -L 'https://github.com/termux/termux-create-package/releases/latest/download/termux-create-package' -o "$install_path/termux-create-package"
35+
sudo chmod 755 "$install_path/termux-create-package"
3636
37-
pip install ruamel.yaml
37+
pip install ruamel.yaml
3838
39-
- name: Prepare version
40-
id: version
41-
run: |
42-
today=$(date +"%Y%m%d")
43-
echo "build-date=$today" >> $GITHUB_OUTPUT
39+
- name: Prepare version
40+
id: version
41+
run: |
42+
today=$(date +"%Y%m%d")
43+
echo "build-date=$today" >> $GITHUB_OUTPUT
4444
45-
revision="${{ github.event.inputs.debian_revision }}"
45+
revision="${{ github.event.inputs.debian_revision }}"
4646
47-
hash=$(git rev-parse --short HEAD)
48-
echo "git-hash=$hash" >> $GITHUB_OUTPUT
47+
hash=$(git rev-parse --short HEAD)
48+
echo "git-hash=$hash" >> $GITHUB_OUTPUT
4949
50-
version="0~git$today+$hash-$revision"
51-
echo "package-version=$version" >> $GITHUB_OUTPUT
50+
version="0~git$today+$hash.bullseye-$revision"
51+
echo "package-version-bullseye=$version" >> $GITHUB_OUTPUT
5252
53-
- name: Build package
54-
run: |
55-
termux-create-package --pkg-version=${{ steps.version.outputs.package-version }} manifest.yml
53+
version="0~git$today+$hash.bookworm-$revision"
54+
echo "package-version-bookworm=$version" >> $GITHUB_OUTPUT
5655
57-
- name: Upload artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: camera-streamer-stack.deb
61-
path: camera-streamer-stack_*.deb
56+
- name: Build packages
57+
run: |
58+
termux-create-package --pkg-version=${{ steps.version.outputs.package-version-bullseye }} manifest-bullseye.yml
59+
termux-create-package --pkg-version=${{ steps.version.outputs.package-version-bookworm }} manifest-bookworm.yml
60+
61+
- name: Upload artifacts
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: camera-streamer-stack.deb
65+
path: camera-streamer-stack_*.deb
6266

6367
release:
6468
name: "Release"
@@ -70,40 +74,40 @@ jobs:
7074
release-assets: ${{ steps.create_release.outputs.assets }}
7175

7276
steps:
73-
- name: Download deb artifact
74-
uses: actions/download-artifact@v4
75-
with:
76-
name: camera-streamer-stack.deb
77-
78-
- name: "📝 Prepare release"
79-
run: |
80-
revision="${{ github.event.inputs.debian_revision }}"
81-
package_version="${{ needs.package.outputs.package-version }}"
82-
build_date="${{ needs.package.outputs.build-date }}"
83-
hash="${{ needs.package.outputs.git-hash }}"
84-
85-
RELEASE_NAME="camera-streamer-stack $package_version"
86-
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
87-
88-
RELEASE_TAG="$build_date-$revision"
89-
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
90-
91-
cat > release.md << EOF
92-
Built from commit $hash.
93-
EOF
94-
95-
- name: "🔖 Create release & attach export"
96-
uses: softprops/action-gh-release@v1
97-
id: create_release
98-
with:
99-
name: "${{ env.RELEASE_NAME }}"
100-
tag_name: "${{ env.RELEASE_TAG }}"
101-
body_path: "release.md"
102-
fail_on_unmatched_files: true
103-
files: |
104-
camera-streamer-stack*.deb
105-
env:
106-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
- name: Download deb artifact
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: camera-streamer-stack.deb
81+
82+
- name: "📝 Prepare release"
83+
run: |
84+
revision="${{ github.event.inputs.debian_revision }}"
85+
package_version="${{ needs.package.outputs.package-version }}"
86+
build_date="${{ needs.package.outputs.build-date }}"
87+
hash="${{ needs.package.outputs.git-hash }}"
88+
89+
RELEASE_NAME="camera-streamer-stack $package_version"
90+
echo "RELEASE_NAME=$RELEASE_NAME" >> $GITHUB_ENV
91+
92+
RELEASE_TAG="$build_date-$revision"
93+
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
94+
95+
cat > release.md << EOF
96+
Built from commit $hash.
97+
EOF
98+
99+
- name: "🔖 Create release & attach export"
100+
uses: softprops/action-gh-release@v1
101+
id: create_release
102+
with:
103+
name: "${{ env.RELEASE_NAME }}"
104+
tag_name: "${{ env.RELEASE_TAG }}"
105+
body_path: "release.md"
106+
fail_on_unmatched_files: true
107+
files: |
108+
camera-streamer-stack*.deb
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107111

108112
notify:
109113
name: "Notify"
@@ -112,20 +116,20 @@ jobs:
112116
needs: release
113117

114118
steps:
115-
- name: "♻ Prepare data"
116-
run: |
117-
cat > assets.json <<EOF
118-
${{ needs.release.outputs.release-assets }}
119-
EOF
120-
121-
URL=$(jq -r '.[0].browser_download_url' assets.json)
122-
123-
echo "DEB_URL=$URL" >> $GITHUB_ENV
124-
125-
- name: "📨 Notify apt repo"
126-
uses: peter-evans/repository-dispatch@v2
127-
with:
128-
token: ${{ secrets.REPO_DISPATCH_ACCESS }}
129-
repository: OctoPrint/apt.octoprint.org
130-
event-type: add-package
131-
client-payload: '{"url": "${{ env.DEB_URL }}", "dist": "bullseye", "component": "rpi"}'
119+
- name: "♻ Prepare data"
120+
run: |
121+
cat > assets.json <<EOF
122+
${{ needs.release.outputs.release-assets }}
123+
EOF
124+
125+
URLS=$(jq -r '.[].browser_download_url' assets.json | tr '\n' ' ')
126+
127+
echo "DEB_URLS=$URLS" >> $GITHUB_ENV
128+
129+
- name: "📨 Notify apt repo"
130+
uses: peter-evans/repository-dispatch@v2
131+
with:
132+
token: ${{ secrets.REPO_DISPATCH_ACCESS }}
133+
repository: OctoPrint/apt.octoprint.org
134+
event-type: add-package
135+
client-payload: '{"urls": "${{ env.DEB_URLS }}", "component": "rpi"}'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ These are the files of the new [`camera-streamer`](https://github.com/ayufan/cam
55
## Requirements
66

77
- `/usr/bin/camera-streamer`, e.g. installed from `camera-streamer-raspi` on [apt.octoprint.org](https://apt.octoprint.org)
8-
- `/usr/bin/libcamera-hello` as contained in `libcamera-apps-lite`
8+
- `/usr/bin/rpicam-hello` as contained in `rpicam-apps-lite` (bookworm) or `/usr/bin/libcamera-hello` as contained in `libcamera-apps-lite` (bullseye)
99
- `/usr/bin/v4l2-ctl` as contained in `v4l-utils`
1010

1111
## Installation

manifest-bookworm.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
control:
2+
Package: camera-streamer-stack
3+
Architecture: all
4+
Maintainer: Gina Häußge <[email protected]>
5+
Depends: camera-streamer, rpicam-apps-lite, v4l-utils
6+
Homepage: https://github.com/OctoPrint/camera-streamer-stack
7+
Description: camera-streamer based webcam stack for OctoPi-UpToDate
8+
9+
installation_prefix: /usr
10+
11+
data_files:
12+
/etc/systemd/system/camera-streamer.service:
13+
source: systemd/camera-streamer.service
14+
perm: 0644
15+
/etc/systemd/system/camera-streamer-libcamera.service:
16+
source: systemd/camera-streamer-libcamera.service
17+
perm: 0644
18+
/etc/systemd/system/[email protected]:
19+
source: systemd/[email protected]
20+
perm: 0644
21+
22+
/etc/camera-streamer.conf.d/libcamera.conf:
23+
source: configs/libcamera.conf
24+
perm: 0644
25+
is_conffile: true
26+
/etc/camera-streamer.conf.d/usb-default.conf:
27+
source: configs/usb-default.conf
28+
perm: 0644
29+
is_conffile: true
30+
31+
bin/camera-streamer-control:
32+
source: scripts/camera-streamer-control
33+
perm: 0755
34+
bin/add-usb-camera:
35+
source: scripts/add-usb-camera
36+
perm: 0755
37+
bin/remove-usb-camera:
38+
source: scripts/remove-usb-camera
39+
perm: 0755
40+
bin/list-usb-cameras:
41+
source: scripts/list-usb-cameras
42+
perm: 0755
43+
bin/list-libcamera-devices:
44+
source: scripts/list-libcamera-devices
45+
perm: 0755

manifest.yml renamed to manifest-bullseye.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ data_files:
4040
bin/list-usb-cameras:
4141
source: scripts/list-usb-cameras
4242
perm: 0755
43+
bin/list-libcamera-devices:
44+
source: scripts/list-libcamera-devices
45+
perm: 0755

0 commit comments

Comments
 (0)