|
| 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-detect-samp-freq: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + env: |
| 15 | + RELEASE_DIR: Release |
| 16 | + outputs: |
| 17 | + release-tag-condition-matched: ${{ steps.release-tag-condition.outputs.matched }} |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v4 |
| 21 | + - name: Build Pico |
| 22 | + uses: ./.github/actions/build-and-rename |
| 23 | + with: |
| 24 | + path: samples/detect_samp_freq |
| 25 | + build: build |
| 26 | + identifier: pico |
| 27 | + output_path: ${{ env.RELEASE_DIR }} |
| 28 | + - name: Build Pico 2 |
| 29 | + uses: ./.github/actions/build-and-rename |
| 30 | + with: |
| 31 | + path: samples/detect_samp_freq |
| 32 | + build: build2 |
| 33 | + platform: rp2350 |
| 34 | + board: pico2 |
| 35 | + identifier: pico2 |
| 36 | + output_path: ${{ env.RELEASE_DIR }} |
| 37 | + - name: Upload production artifacts |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: dist-binaries0 |
| 41 | + path: | |
| 42 | + ${{ env.RELEASE_DIR }}/*.uf2 |
| 43 | + ${{ env.RELEASE_DIR }}/*.elf |
| 44 | +
|
| 45 | + build-spdif-to-i2s-32b: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + env: |
| 48 | + RELEASE_DIR: Release |
| 49 | + outputs: |
| 50 | + release-tag-condition-matched: ${{ steps.release-tag-condition.outputs.matched }} |
| 51 | + steps: |
| 52 | + - name: Checkout |
| 53 | + uses: actions/checkout@v4 |
| 54 | + - name: Build Pico |
| 55 | + uses: ./.github/actions/build-and-rename |
| 56 | + with: |
| 57 | + path: samples/spdif_to_i2s_32b |
| 58 | + build: build |
| 59 | + identifier: pico |
| 60 | + output_path: ${{ env.RELEASE_DIR }} |
| 61 | + - name: Build Pico 2 |
| 62 | + uses: ./.github/actions/build-and-rename |
| 63 | + with: |
| 64 | + path: samples/spdif_to_i2s_32b |
| 65 | + build: build2 |
| 66 | + platform: rp2350 |
| 67 | + board: pico2 |
| 68 | + identifier: pico2 |
| 69 | + output_path: ${{ env.RELEASE_DIR }} |
| 70 | + - name: Upload production artifacts |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: dist-binaries1 |
| 74 | + path: | |
| 75 | + ${{ env.RELEASE_DIR }}/*.uf2 |
| 76 | + ${{ env.RELEASE_DIR }}/*.elf |
| 77 | +
|
| 78 | + release-tag-condition: |
| 79 | + runs-on: ubuntu-latest |
| 80 | + outputs: |
| 81 | + matched: ${{ steps.check.outputs.matched }} |
| 82 | + steps: |
| 83 | + - name: Check if Release Tag Condition Matched |
| 84 | + id: check |
| 85 | + run: | |
| 86 | + if [[ ${{ github.ref_type }} == 'tag' && ${{ github.ref_name }} =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then |
| 87 | + echo "matched=true" >> $GITHUB_OUTPUT |
| 88 | + echo "Release tag condition matched" |
| 89 | + else |
| 90 | + echo "matched=false" >> $GITHUB_OUTPUT |
| 91 | + echo "Release tag condition not matched" |
| 92 | + fi |
| 93 | +
|
| 94 | + call-upload-release-asset: |
| 95 | + needs: [build-detect-samp-freq, build-spdif-to-i2s-32b, release-tag-condition] |
| 96 | + if: ${{ needs.release-tag-condition.outputs.matched == 'true' }} |
| 97 | + uses: ./.github/workflows/upload-release-asset.yml |
| 98 | + with: |
| 99 | + source_run_id: ${{ github.run_id }} |
0 commit comments