Skip to content

Commit 74fba4a

Browse files
committed
feat: add support for extra artifacts in release process
1 parent 719325e commit 74fba4a

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/blocks/build-makefile-dylib/action.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ inputs:
99
required: false
1010
default: ''
1111
description: "Version to embed (passed as VERSION= to make)"
12+
extra-artifacts:
13+
required: false
14+
default: ''
15+
description: "Newline-separated list of additional build outputs (paths relative to repo root) to attach to the release. Each path is copied into artifacts/ alongside the dylib."
1216

1317
runs:
1418
using: "composite"
@@ -32,6 +36,30 @@ runs:
3236
3337
- name: Prepare artifact
3438
shell: bash
39+
env:
40+
EXTRA_ARTIFACTS: ${{ inputs.extra-artifacts }}
3541
run: |
3642
mkdir -p artifacts
3743
cp "build/${{ inputs.output-name }}.dylib" artifacts/
44+
45+
if [ -n "$EXTRA_ARTIFACTS" ]; then
46+
while IFS= read -r raw; do
47+
# strip leading/trailing whitespace
48+
extra="${raw#"${raw%%[![:space:]]*}"}"
49+
extra="${extra%"${extra##*[![:space:]]}"}"
50+
51+
# skip blank lines and comments
52+
if [ -z "$extra" ] || [ "${extra#\#}" != "$extra" ]; then
53+
continue
54+
fi
55+
56+
if [ ! -f "$extra" ]; then
57+
echo "::error::extra artifact '$extra' not found — build failure"
58+
exit 1
59+
fi
60+
61+
echo "Including extra artifact: $extra"
62+
file "$extra"
63+
cp "$extra" artifacts/
64+
done <<< "$EXTRA_ARTIFACTS"
65+
fi

.github/workflows/makefile-dylib-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
required: false
1212
default: false
1313
description: "Opt in to Blacksmith Linux runners (blacksmith-4vcpu-ubuntu-2404). Requires the Blacksmith GitHub App installed on the caller org. Defaults to ubuntu-latest."
14+
extra-artifacts:
15+
type: string
16+
required: false
17+
default: ''
18+
description: "Newline-separated list of extra build outputs (relative to repo root) to attach to the release alongside the dylib."
1419
secrets:
1520
OPENAI_API_KEY:
1621
required: true
@@ -60,6 +65,7 @@ jobs:
6065
with:
6166
output-name: ${{ inputs.dylib-name }}
6267
version: ${{ needs.prepare-release.outputs.version }}
68+
extra-artifacts: ${{ inputs.extra-artifacts }}
6369
- uses: actions/upload-artifact@v4
6470
with:
6571
name: ${{ inputs.dylib-name }}

0 commit comments

Comments
 (0)