Skip to content

Commit

Permalink
Use the output name as the archive name
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed May 4, 2024
1 parent 99d24fc commit bb1d40f
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,6 @@ jobs:
steps:
- uses: actions/[email protected]

- name: Parse firmware manifest
id: read_manifest_yaml
run: |
yq -r '
to_entries
| .[]
| select(.value | type == "string")
| .key + "=" + .value
' "${{ matrix.manifest }}" >> $GITHUB_OUTPUT
manifest_filename=$(basename "${{ matrix.manifest }}")
manifest_base="${manifest_filename%%.*}"
echo "manifest_base=$manifest_base" >> $GITHUB_OUTPUT
- name: Install SDK extensions
run: |
# XXX: slc-cli does not actually work when the extensions aren't in the SDK!
Expand All @@ -137,6 +123,7 @@ jobs:
done
- name: Build firmware
id: build-firmware
run: |
# Fix `fatal: detected dubious ownership in repository at`
git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand All @@ -154,18 +141,20 @@ jobs:
done
# Build it
mkdir outputs
filename="${{ steps.read_manifest_yaml.outputs['manifest_base'] }}"
python3 tools/build_project.py \
$sdk_args \
$toolchain_args \
--manifest "${{ matrix.manifest }}" \
--build-dir build \
--build-system makefile \
--output "gbl:outputs/$filename.gbl" \
--output "hex:outputs/$filename.hex" \
--output "out:outputs/$filename.out"
--output-dir outputs \
--output gbl" \
--output hex" \
--output out"
# Get the basename of the GBL in `outputs`
output_basename=$(basename -- $(basename -- $(ls -1 artifacts/*.gbl | head -n 1)) .gbl)
echo "output_basename=$output_basename" >> $GITHUB_OUTPUT
- name: Install node within container (act)
if: ${{ env.ACT }}
Expand All @@ -176,7 +165,7 @@ jobs:
- name: Upload artifact
uses: actions/[email protected]
with:
name: ${{ steps.read_manifest_yaml.outputs['manifest_base'] }}
name: ${{ steps.build-firmware.outputs.output_basename }}
path: outputs/*
compression-level: 9
if-no-files-found: error

0 comments on commit bb1d40f

Please sign in to comment.