Skip to content

Commit 819eea2

Browse files
committed
CI/CD: Use nix to build
By using Nix in CI, we reference flake.lock. This file pins the version of all inputs to this build. Previously, the version of nixpkgs and vesc_tool were technically not reproducible because they reference branches which may change. The flake.lock converts those references to commit SHAs, which are tracked by git. This commit comes with the cost that maintainers of this repository must commit a flake.lock update when updating versions. Changing version strings without doing this is not valid. However, this commit comes with a benefit that CI is binary reproducible locally.
1 parent 3efebb5 commit 819eea2

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

‎.github/actions/build/action.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ runs:
1313
with:
1414
name: refloat
1515
authToken: '${{ inputs.cache-auth-token }}'
16-
- uses: rrbutani/use-nix-shell-action@v1
17-
with:
18-
flakes: nixpkgs/nixos-24.11#gcc-arm-embedded-13, nixpkgs#gnumake, github:lukash/vesc_tool-flake/release_6_06
1916

2017
- name: Build
2118
shell: bash
22-
run: make -j
19+
run: nix build .#refloat

‎.github/workflows/create_release.yml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ jobs:
5151
with:
5252
cache-auth-token: '${{ secrets.CACHIX_AUTH_TOKEN }}'
5353

54-
- name: Extract Config Signature
55-
run: cat src/conf/confparser.h | sed -n 's/^#define .\+_SIGNATURE\W\+\([0-9]*\)/\1/p' > config_signature.txt
56-
5754
- name: Rename Package File
5855
run: |
59-
mv refloat.vescpkg refloat-${{env.VERSION}}.vescpkg
60-
mv src/package_lib.elf refloat-${{env.VERSION}}.elf
56+
cp result/refloat.vescpkg refloat-${{env.VERSION}}.vescpkg
57+
cp result/refloat.elf refloat-${{env.VERSION}}.elf
58+
cp result/config_signature.txt config_signature.txt
6159
6260
- name: Install Changelog Generation Dependencies
6361
run: sudo apt-get install python3-git

0 commit comments

Comments
 (0)