-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.16 KB
/
build-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and Release Debian Package
on:
push:
tags:
- 'v*.*.*' # Run on version tags
permissions:
contents: write
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to get all tags for version verification
- name: Set up version variables
run: |
# Extract version from tag
TAG_VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
echo "PACKAGE_VERSION=$TAG_VERSION" >> $GITHUB_ENV
# Make scripts executable
chmod +x build.sh tools/verify-versions.sh
- name: Verify versions match tag
run: |
# Verify the tag matches our package versions
if ! tools/verify-versions.sh; then
echo "::error::Version mismatch detected. Package versions must match git tag."
exit 1
fi
- name: Build package
run: ./build.sh
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
../gecko-controller_*.deb
../gecko-controller_*.buildinfo
../gecko-controller_*.changes
draft: false
prerelease: false
generate_release_notes: true
body: |
Gecko Controller Release ${{ github.ref_name }}
## Installation
```bash
sudo apt update
sudo apt install ./gecko-controller_*.deb
```
Please ensure I2C is enabled on your Raspberry Pi before installation.
For full installation instructions, see the README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Move build artifacts to workspace
run: |
mkdir -p artifacts
cp ../gecko-controller_*.deb artifacts/
cp ../gecko-controller_*.buildinfo artifacts/
cp ../gecko-controller_*.changes artifacts/
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: debian-packages
path: artifacts/
if-no-files-found: error