66 debian_revision :
77 description : " Debian revision to use"
88 required : false
9- default : ' 1 '
9+ default : " 1 "
1010
1111jobs :
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"}'
0 commit comments