1+ # .github/workflows/build-deb.yml
2+
3+ name : Build Debian Package
4+
5+ # This action runs on every push to the main branch
6+ on :
7+ push :
8+ branches : [ "main", "deb_package_pipeline" ]
9+ pull_request :
10+ branches : [ "main", "deb_package_pipeline" ]
11+
12+ jobs :
13+ build :
14+ # Use the latest version of Ubuntu as our build environment
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ # 1. Check out your repository's code
19+ - name : Checkout code
20+ uses : actions/checkout@v4
21+
22+ # 2. Set up the Go environment needed by arduino-cli
23+ - name : Setup Go
24+ uses : actions/setup-go@v5
25+ with :
26+ go-version : ' 1.25' # Check go.mod for the correct version
27+
28+ # 3. Install Debian packaging tools
29+ - name : Install dependencies
30+ run : |
31+ sudo apt-get update
32+ sudo apt-get install -y debmake devscripts
33+
34+ # 4. Generate the initial debian/ directory
35+ # The -y flag accepts defaults, useful for automation
36+ - name : Run debmake to create packaging files
37+ run : debmake -g -y
38+
39+ # 5. Build the .deb package
40+ # The flags -us -uc mean "unsigned source" and "unsigned changes",
41+ # which is necessary because we don't have a GPG key in the runner.
42+ - name : Build the package
43+ run : debuild -us -uc
44+
45+ # 6. Upload the generated .deb file as a build artifact
46+ # The .deb file is created in the parent directory, hence the ../
47+ - name : Upload .deb package
48+ uses : actions/upload-artifact@v4
49+ with :
50+ name : arduino-cli-deb-package
51+ path : ../*.deb
0 commit comments