Skip to content

Commit abda498

Browse files
committed
feat: Added classic snap packaging
1 parent 978f1ce commit abda498

2 files changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/package.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,37 @@ jobs:
6868
with:
6969
name: framework-tool-rpm
7070
path: target/generate-rpm/*.rpm
71+
72+
build-snap:
73+
name: Build Snap
74+
runs-on: ubuntu-24.04
75+
steps:
76+
- uses: actions/checkout@v6
77+
78+
- name: Build snap
79+
uses: snapcore/action-build@v1
80+
id: build
81+
82+
- name: Upload snap artifact
83+
uses: actions/upload-artifact@v6
84+
with:
85+
name: framework-tool-snap
86+
path: ${{ steps.build.outputs.snap }}
87+
88+
- name: Publish to edge channel
89+
if: github.ref == 'refs/heads/main'
90+
uses: snapcore/action-publish@v1
91+
env:
92+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
93+
with:
94+
snap: ${{ steps.build.outputs.snap }}
95+
release: edge
96+
97+
- name: Publish to candidate channel
98+
if: github.ref_type == 'tag' || github.event_name == 'release'
99+
uses: snapcore/action-publish@v1
100+
env:
101+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
102+
with:
103+
snap: ${{ steps.build.outputs.snap }}
104+
release: candidate

snap/snapcraft.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: framework-tool
2+
base: core24
3+
adopt-info: framework-tool
4+
summary: CLI tool to inspect and control Framework Computer systems
5+
description: |
6+
framework_tool is a CLI utility to interact with Framework Computer laptop
7+
and desktop firmware and hardware. Features include:
8+
.
9+
- Firmware inspection and updates (BIOS, EC, PD controllers, retimers)
10+
- System status monitoring (power, thermal, sensors, USB-C ports)
11+
- Hardware configuration (keyboard backlight, battery charge limits, fan control)
12+
- Expansion card management (HDMI/DP/audio cards)
13+
- Framework 16 specific features (input deck, expansion bay)
14+
- NVIDIA GPU support
15+
.
16+
Note: Most features require root privileges (sudo framework-tool ...).
17+
18+
grade: stable
19+
confinement: classic
20+
compression: lzo
21+
22+
parts:
23+
framework-tool:
24+
plugin: rust
25+
source: .
26+
build-packages:
27+
- libhidapi-dev
28+
- libusb-1.0-0-dev
29+
- libudev-dev
30+
- pkg-config
31+
stage-packages:
32+
- libhidapi-hidraw0
33+
- libusb-1.0-0
34+
- libudev1
35+
override-pull: |
36+
craftctl default
37+
VERSION=$(craftctl get version)
38+
if [ -z $VERSION ]; then
39+
VERSION=$(git describe --tags --abbrev=10)
40+
craftctl set version=$VERSION
41+
fi
42+
override-build: |
43+
cd "${CRAFT_PART_SRC}"
44+
cargo build --release -p framework_tool --features nvidia
45+
install -Dm755 target/release/framework_tool "${CRAFT_PART_INSTALL}/bin/framework_tool"
46+
install -Dm644 "${CRAFT_PART_SRC}/completions/bash/framework_tool" \
47+
"${CRAFT_PART_INSTALL}/share/bash-completion/completions/framework_tool"
48+
install -Dm644 "${CRAFT_PART_SRC}/completions/zsh/_framework_tool" \
49+
"${CRAFT_PART_INSTALL}/share/zsh/site-functions/_framework_tool"
50+
install -Dm644 "${CRAFT_PART_SRC}/completions/fish/framework_tool.fish" \
51+
"${CRAFT_PART_INSTALL}/share/fish/vendor_completions.d/framework_tool.fish"
52+
53+
apps:
54+
framework-tool:
55+
command: bin/framework_tool

0 commit comments

Comments
 (0)