Skip to content

Commit b824e81

Browse files
author
Your Name
committed
packaging
1 parent 27531bd commit b824e81

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/build-deb.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# .github/workflows/build-deb.yml
2+
3+
name: Build Debian Package
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
# 1. Checkout code with full history for versioning
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
# 2. Set up the Go environment
23+
- name: Setup Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.22'
27+
28+
# 3. Install all necessary packaging tools
29+
- name: Install dependencies
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y debmake devscripts dh-golang
33+
34+
# 4. Run debmake to create the debian/ directory and its files
35+
- name: Run debmake to create packaging files
36+
run: debmake -y -ccc
37+
38+
# 5. (NEW) Verify that the debian/ directory was created
39+
- name: Verify debian/ directory existence
40+
run: |
41+
if [ ! -d "debian" ]; then
42+
echo "Error: debian/ directory was not created by debmake."
43+
exit 1
44+
fi
45+
echo "Success: debian/ directory created."
46+
ls -l
47+
48+
# 6. Create the watch file for checking new upstream versions
49+
- name: Create debian/watch file
50+
run: |
51+
echo 'version=4' > debian/watch
52+
echo 'opts="filenamemangle=s/.+\/v?(\d+\.\d+\.\d+)\.tar\.gz/arduino-cli-$1.tar.gz/" \' >> debian/watch
53+
echo ' https://github.com/arduino/arduino-cli/tags .*/v?(\d+\.\d+\.\d+)\.tar\.gz' >> debian/watch
54+
55+
# 7. Create a proper changelog with the correct version
56+
- name: Create changelog with dch
57+
run: |

0 commit comments

Comments
 (0)