Skip to content

Commit 08aeac4

Browse files
committed
Well, because why not when we're at it
1 parent 539112b commit 08aeac4

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/buildtools.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
branches: [dev]
1515
# Allows you to run this workflow manually from the Actions tab when needed
1616
workflow_dispatch:
17+
# Enables calling from other workflows
18+
workflow_call:
1719

1820
jobs:
1921
build-tools:

.github/workflows/tagged_build.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
branches: [master, dev]
1616
# Allows you to run this workflow manually from the Actions tab when needed
1717
workflow_dispatch:
18+
# Enables calling from other workflows
19+
workflow_call:
1820

1921
jobs:
2022
cleanup_previous_builds: # Delete unfinished draft prereleases, and prereleases older than 30 days (but keep at least 10)
@@ -223,6 +225,7 @@ jobs:
223225
run: |
224226
echo $RELEASE_VERSION
225227
echo ${{ steps.vars.outputs.tag }}
228+
226229
- name: 🛠️ Arm GNU Toolchain (arm-none-eabi-gcc)
227230
uses: carlosperate/arm-none-eabi-gcc-action@v1
228231

@@ -417,9 +420,40 @@ jobs:
417420
data: fs.readFileSync(ASSET_PATH)
418421
});
419422
423+
build-tools:
424+
uses: ./.github/workflows/buildtools.yml
425+
needs: create_release
426+
427+
# Final job to collect everything and upload to the release
428+
upload-build-tools:
429+
needs: [create_release, build-tools]
430+
runs-on: ubuntu-latest
431+
steps:
432+
- name: Download Tools Artifacts
433+
uses: actions/download-artifact@v4
434+
with:
435+
pattern: '(cfg_usbsid*|send_sid*)'
436+
path: tools-output
437+
- name: Upload to Release
438+
uses: actions/github-script@v7
439+
with:
440+
script: |
441+
const fs = require('fs');
442+
const path = 'tools-output';
443+
const files = fs.readdirSync(path);
444+
for (const file of files) {
445+
await github.rest.repos.uploadReleaseAsset({
446+
owner: context.repo.owner,
447+
repo: context.repo.repo,
448+
release_id: '${{ needs.create_release.outputs.release_id }}',
449+
name: file,
450+
data: fs.readFileSync(`${path}/${file}`)
451+
});
452+
}
453+
420454
publish_release:
421455
name: Publish Release
422-
needs: [create_release, build]
456+
needs: [create_release, build, upload-build-tools]
423457
runs-on: ubuntu-latest
424458
if: startsWith(github.ref, 'refs/tags/d')
425459
steps:

0 commit comments

Comments
 (0)