|
| 1 | +#------------------------------------------------------ |
| 2 | +# Copyright (c) 2025, Elehobica |
| 3 | +# Released under the BSD-2-Clause |
| 4 | +# refer to https://opensource.org/licenses/BSD-2-Clause |
| 5 | +#------------------------------------------------------ |
| 6 | + |
| 7 | +name: Build |
| 8 | + |
| 9 | +on: [push, pull_request] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-sine-wave-i2s_32b: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + env: |
| 15 | + PROJECT_DIR: samples/sine_wave_i2s_32b |
| 16 | + RELEASE_DIR: Release |
| 17 | + outputs: |
| 18 | + release-tag-condition-matched: ${{ steps.release-tag-condition.outputs.matched }} |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + - name: Build Pico |
| 23 | + uses: ./.github/actions/build-and-rename |
| 24 | + with: |
| 25 | + path: ${{ env.PROJECT_DIR }} |
| 26 | + build: build |
| 27 | + identifier: pico |
| 28 | + output_path: ${{ env.RELEASE_DIR }} |
| 29 | + - name: Build Pico 2 |
| 30 | + uses: ./.github/actions/build-and-rename |
| 31 | + with: |
| 32 | + path: ${{ env.PROJECT_DIR }} |
| 33 | + build: build2 |
| 34 | + platform: rp2350 |
| 35 | + board: pico2 |
| 36 | + identifier: pico2 |
| 37 | + output_path: ${{ env.RELEASE_DIR }} |
| 38 | + - name: Upload production artifacts |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: dist-binaries0 |
| 42 | + path: | |
| 43 | + ${{ env.RELEASE_DIR }}/*.uf2 |
| 44 | + ${{ env.RELEASE_DIR }}/*.elf |
| 45 | +
|
| 46 | + release-tag-condition: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + outputs: |
| 49 | + matched: ${{ steps.check.outputs.matched }} |
| 50 | + steps: |
| 51 | + - name: Check if Release Tag Condition Matched |
| 52 | + id: check |
| 53 | + run: | |
| 54 | + if [[ ${{ github.ref_type }} == 'tag' && ${{ github.ref_name }} =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then |
| 55 | + echo "matched=true" >> $GITHUB_OUTPUT |
| 56 | + echo "Release tag condition matched" |
| 57 | + else |
| 58 | + echo "matched=false" >> $GITHUB_OUTPUT |
| 59 | + echo "Release tag condition not matched" |
| 60 | + fi |
| 61 | +
|
| 62 | + call-upload-release-asset: |
| 63 | + needs: [build-sine-wave-i2s_32b, release-tag-condition] |
| 64 | + if: ${{ needs.release-tag-condition.outputs.matched == 'true' }} |
| 65 | + uses: ./.github/workflows/upload-release-asset.yml |
| 66 | + with: |
| 67 | + source_run_id: ${{ github.run_id }} |
| 68 | + artifacts_dirs: "dist-binaries0" |
0 commit comments