Skip to content

Commit 0d97056

Browse files
committed
ci: reorder drv before full build, split iso/sha256 artifacts
- Drop '(in nixos/nix container)' from step names. - In Build ISO, run the drv instantiation step before the full ISO build step. - Upload the ISO and its .sha256 as two separate artifacts (was a single *.iso* artifact that zipped both together) in both workflows.
1 parent f007c36 commit 0d97056

2 files changed

Lines changed: 37 additions & 21 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,23 @@ jobs:
9393
# dispatch to build an arbitrary commit.
9494
ref: ${{ github.event.inputs.ref }}
9595

96-
- name: Build full ISO (in nixos/nix container)
96+
- name: Instantiate ISO derivation
97+
# No label on a PR: just evaluate the .drv (cheap validation, no image).
98+
if: env.FULL != 'true'
99+
env:
100+
TARGET: ${{ matrix.target }}
101+
run: |
102+
docker run --rm \
103+
-v "$PWD":/work -w /work \
104+
-e TARGET \
105+
nixos/nix:latest \
106+
sh -euc '
107+
export NIX_CONFIG="experimental-features = nix-command flakes"
108+
git config --global --add safe.directory /work
109+
nix-shell -p gnumake git --run "make $TARGET/drv"
110+
'
111+
112+
- name: Build full ISO
97113
# Label present (or non-PR event): realise the full image.
98114
if: env.FULL == 'true'
99115
id: build
@@ -129,29 +145,22 @@ jobs:
129145
'
130146
ls -lh "$dist"
131147
132-
- name: Instantiate ISO derivation (in nixos/nix container)
133-
# No label on a PR: just evaluate the .drv (cheap validation, no image).
134-
if: env.FULL != 'true'
135-
env:
136-
TARGET: ${{ matrix.target }}
137-
run: |
138-
docker run --rm \
139-
-v "$PWD":/work -w /work \
140-
-e TARGET \
141-
nixos/nix:latest \
142-
sh -euc '
143-
export NIX_CONFIG="experimental-features = nix-command flakes"
144-
git config --global --add safe.directory /work
145-
nix-shell -p gnumake git --run "make $TARGET/drv"
146-
'
147-
148148
- name: Upload ISO artifact
149149
# drv-only runs produce no image, so nothing to upload.
150150
if: env.FULL == 'true'
151151
uses: actions/upload-artifact@v5
152152
with:
153153
name: coder-box-${{ matrix.target }}-${{ matrix.system }}
154-
path: ${{ steps.build.outputs.dist }}/*.iso*
154+
path: ${{ steps.build.outputs.dist }}/*.iso
155155
# Verification build; keep storage cost minimal.
156156
retention-days: 1
157157
if-no-files-found: error
158+
159+
- name: Upload ISO checksum artifact
160+
if: env.FULL == 'true'
161+
uses: actions/upload-artifact@v5
162+
with:
163+
name: coder-box-${{ matrix.target }}-${{ matrix.system }}-sha256
164+
path: ${{ steps.build.outputs.dist }}/*.iso.sha256
165+
retention-days: 1
166+
if-no-files-found: error

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
# to release an arbitrary commit.
7373
ref: ${{ github.event.inputs.ref }}
7474

75-
- name: Build ISO (in nixos/nix container)
75+
- name: Build ISO
7676
id: build
7777
env:
7878
TARGET: ${{ matrix.target }}
@@ -104,11 +104,18 @@ jobs:
104104
'
105105
ls -lh "$dist"
106106
107-
- name: Upload build artifact
107+
- name: Upload ISO artifact
108108
uses: actions/upload-artifact@v5
109109
with:
110110
name: coder-box-${{ matrix.target }}-${{ matrix.system }}
111-
path: ${{ steps.build.outputs.dist }}/*.iso*
111+
path: ${{ steps.build.outputs.dist }}/*.iso
112+
if-no-files-found: error
113+
114+
- name: Upload ISO checksum artifact
115+
uses: actions/upload-artifact@v5
116+
with:
117+
name: coder-box-${{ matrix.target }}-${{ matrix.system }}-sha256
118+
path: ${{ steps.build.outputs.dist }}/*.iso.sha256
112119
if-no-files-found: error
113120

114121
release:

0 commit comments

Comments
 (0)