|
15 | 15 | branches: [master, dev] |
16 | 16 | # Allows you to run this workflow manually from the Actions tab when needed |
17 | 17 | workflow_dispatch: |
| 18 | + # Enables calling from other workflows |
| 19 | + workflow_call: |
18 | 20 |
|
19 | 21 | jobs: |
20 | 22 | cleanup_previous_builds: # Delete unfinished draft prereleases, and prereleases older than 30 days (but keep at least 10) |
@@ -223,6 +225,7 @@ jobs: |
223 | 225 | run: | |
224 | 226 | echo $RELEASE_VERSION |
225 | 227 | echo ${{ steps.vars.outputs.tag }} |
| 228 | +
|
226 | 229 | - name: 🛠️ Arm GNU Toolchain (arm-none-eabi-gcc) |
227 | 230 | uses: carlosperate/arm-none-eabi-gcc-action@v1 |
228 | 231 |
|
@@ -417,9 +420,40 @@ jobs: |
417 | 420 | data: fs.readFileSync(ASSET_PATH) |
418 | 421 | }); |
419 | 422 |
|
| 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 | +
|
420 | 454 | publish_release: |
421 | 455 | name: Publish Release |
422 | | - needs: [create_release, build] |
| 456 | + needs: [create_release, build, upload-build-tools] |
423 | 457 | runs-on: ubuntu-latest |
424 | 458 | if: startsWith(github.ref, 'refs/tags/d') |
425 | 459 | steps: |
|
0 commit comments