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+ - name : Run debmake to create packaging files
35+ run : debmake -t go -y -ccc
36+
37+ - name : Create changelog with dch
38+ run : |
39+ UPSTREAM_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
40+ dch --create --package arduino-cli --newversion "${UPSTREAM_VERSION}-1" "Initial release."
41+
42+ # 5. Build the .deb package
43+ # The flags -us -uc mean "unsigned source" and "unsigned changes",
44+ # which is necessary because we don't have a GPG key in the runner.
45+ - name : Build the package
46+ run : debuild -us -uc
47+
48+ # 6. Upload the generated .deb file as a build artifact
49+ # The .deb file is created in the parent directory, hence the ../
50+ - name : Upload .deb package
51+ uses : actions/upload-artifact@v4
52+ with :
53+ name : arduino-cli-deb-package
54+ path : ../*.deb
0 commit comments