Skip to content

Merge pull request #4 from elehobica/introduce-github-workflows #12

Merge pull request #4 from elehobica/introduce-github-workflows

Merge pull request #4 from elehobica/introduce-github-workflows #12

#------------------------------------------------------
# Copyright (c) 2025, Elehobica
# Released under the BSD-2-Clause
# refer to https://opensource.org/licenses/BSD-2-Clause
#------------------------------------------------------
name: Build
on: [push, pull_request]
jobs:
build-sine-wave-i2s_32b:
runs-on: ubuntu-latest
env:
PROJECT_DIR: samples/sine_wave_i2s_32b
RELEASE_DIR: Release
outputs:
release-tag-condition-matched: ${{ steps.release-tag-condition.outputs.matched }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Pico
uses: ./.github/actions/build-and-rename
with:
path: ${{ env.PROJECT_DIR }}
build: build
identifier: pico
output_path: ${{ env.RELEASE_DIR }}
- name: Build Pico 2
uses: ./.github/actions/build-and-rename
with:
path: ${{ env.PROJECT_DIR }}
build: build2
platform: rp2350
board: pico2
identifier: pico2
output_path: ${{ env.RELEASE_DIR }}
- name: Upload production artifacts
uses: actions/upload-artifact@v4
with:
name: dist-binaries0
path: |
${{ env.RELEASE_DIR }}/*.uf2
${{ env.RELEASE_DIR }}/*.elf
release-tag-condition:
runs-on: ubuntu-latest
outputs:
matched: ${{ steps.check.outputs.matched }}
steps:
- name: Check if Release Tag Condition Matched
id: check
run: |
if [[ ${{ github.ref_type }} == 'tag' && ${{ github.ref_name }} =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "matched=true" >> $GITHUB_OUTPUT
echo "Release tag condition matched"
else
echo "matched=false" >> $GITHUB_OUTPUT
echo "Release tag condition not matched"
fi
call-upload-release-asset:
needs: [build-sine-wave-i2s_32b, release-tag-condition]
if: ${{ needs.release-tag-condition.outputs.matched == 'true' }}
uses: ./.github/workflows/upload-release-asset.yml
with:
source_run_id: ${{ github.run_id }}
artifacts_dirs: "dist-binaries0"