Skip to content

Commit 0b515a8

Browse files
ci: add release workflow; bump to v0.12.1; pin linux-wire to v0.1.1
1 parent 83fd9db commit 0b515a8

6 files changed

Lines changed: 108 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,14 @@ jobs:
3838
uses: actions/cache@v4
3939
with:
4040
path: third_party/linux-wire/install
41-
key: linux-wire-${{ runner.os }}-v1
41+
key: linux-wire-${{ runner.os }}-0.1.1
4242

43-
- name: Build linux-wire
43+
- name: Install linux-wire from release
4444
if: steps.cache-linux-wire.outputs.cache-hit != 'true'
4545
run: |
46-
git clone --depth=1 https://github.com/feastorg/linux-wire.git third_party/linux-wire
47-
cmake -S third_party/linux-wire -B third_party/linux-wire/build \
48-
-DCMAKE_BUILD_TYPE=Release \
49-
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/third_party/linux-wire/install
50-
cmake --build third_party/linux-wire/build --parallel
51-
cmake --install third_party/linux-wire/build
46+
mkdir -p third_party/linux-wire/install
47+
curl -fsSL https://github.com/feastorg/linux-wire/releases/download/v0.1.1/linux-wire-0.1.1-linux-x86_64.tar.gz \
48+
| tar -xz -C third_party/linux-wire/install
5249
5350
# ---------------------------------------------------------------------
5451
# Build & test CRUMBS

.github/workflows/release.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release-linux-x86_64:
13+
name: Release (linux-x86_64)
14+
runs-on: ubuntu-22.04
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install dependencies
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y cmake ninja-build build-essential jq
23+
24+
- name: Extract version
25+
id: version
26+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
27+
28+
- name: Install linux-wire from release
29+
run: |
30+
mkdir -p third_party/linux-wire/install
31+
curl -fsSL https://github.com/feastorg/linux-wire/releases/download/v0.1.1/linux-wire-0.1.1-linux-x86_64.tar.gz \
32+
| tar -xz -C third_party/linux-wire/install
33+
34+
- name: Configure CRUMBS (Linux HAL enabled)
35+
run: |
36+
cmake -S . -B build/release \
37+
-G Ninja \
38+
-DCMAKE_BUILD_TYPE=Release \
39+
-DCRUMBS_ENABLE_TESTS=ON \
40+
-DCRUMBS_ENABLE_LINUX_HAL=ON \
41+
-DCRUMBS_BUILD_EXAMPLES=OFF \
42+
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/third_party/linux-wire/install"
43+
44+
- name: Build
45+
run: cmake --build build/release --parallel
46+
47+
- name: Test
48+
run: ctest --test-dir build/release --output-on-failure
49+
50+
- name: Install to staging
51+
run: |
52+
cmake --install build/release \
53+
--prefix "${{ github.workspace }}/staging"
54+
55+
- name: Package binary artifact
56+
id: package
57+
run: |
58+
VERSION="${{ steps.version.outputs.version }}"
59+
ARTIFACT="crumbs-${VERSION}-linux-x86_64.tar.gz"
60+
tar -czf "${ARTIFACT}" -C "${{ github.workspace }}/staging" .
61+
echo "artifact=${ARTIFACT}" >> "$GITHUB_OUTPUT"
62+
63+
- name: Package source tarball
64+
run: |
65+
VERSION="${{ steps.version.outputs.version }}"
66+
git archive --format=tar.gz \
67+
--prefix="crumbs-${VERSION}/" \
68+
-o "crumbs-${VERSION}-source.tar.gz" \
69+
HEAD
70+
71+
- name: Generate checksums
72+
run: sha256sum crumbs-*.tar.gz > SHA256SUMS
73+
74+
- name: Generate manifest
75+
run: |
76+
VERSION="${{ steps.version.outputs.version }}"
77+
ARTIFACT="${{ steps.package.outputs.artifact }}"
78+
SHA=$(grep "${ARTIFACT}" SHA256SUMS | awk '{print $1}')
79+
jq -n \
80+
--argjson schema_version 1 \
81+
--arg repo "feastorg/CRUMBS" \
82+
--arg component "crumbs" \
83+
--arg version "${VERSION}" \
84+
--arg platform "linux-x86_64" \
85+
--arg asset "${ARTIFACT}" \
86+
--arg sha256 "${SHA}" \
87+
'{schema_version: $schema_version, repo: $repo, component: $component, version: $version, platform: $platform, asset: $asset, sha256: $sha256}' \
88+
> manifest.json
89+
90+
- name: Create GitHub release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
files: |
94+
crumbs-*.tar.gz
95+
SHA256SUMS
96+
manifest.json
97+
generate_release_notes: true

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.13)
22

33
project(CRUMBS
4-
VERSION 0.12.0
4+
VERSION 0.12.1
55
LANGUAGES C
66
)
77

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CRUMBS",
3-
"version": "0.12.0",
3+
"version": "0.12.1",
44
"description": "CRUMBS: a small, portable C-based protocol for controller/peripheral I2C messaging (Arduino + Linux HALs).",
55
"keywords": "i2c,crumbs,crc,arduino,linux,protocol",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=CRUMBS
2-
version=0.12.0
2+
version=0.12.1
33
author=Cameron
44
maintainer=Cameron <cambrooks3393@gmail.com>
55
sentence=CRUMBS: A communication library for managing data exchange between peripheral devices and a controller using serialization over I2C.

src/crumbs_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
#define CRUMBS_VERSION_MAJOR 0
55
#define CRUMBS_VERSION_MINOR 12
6-
#define CRUMBS_VERSION_PATCH 0
7-
#define CRUMBS_VERSION_STRING "0.12.0"
8-
#define CRUMBS_VERSION 1200 // major*10000 + minor*100 + patch
6+
#define CRUMBS_VERSION_PATCH 1
7+
#define CRUMBS_VERSION_STRING "0.12.1"
8+
#define CRUMBS_VERSION 1201 // major*10000 + minor*100 + patch
99

1010
#endif // CRUMBS_VERSION_H

0 commit comments

Comments
 (0)