feat: add discord #1565
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Firmware | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| - "*.*.*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v4.2.2 | |
| - name: Install sox | |
| run: | | |
| sudo apt update | |
| sudo apt install sox libsox-fmt-mp3 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3.0.0 | |
| with: | |
| hugo-version: "0.135.0" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5.6.0 | |
| with: | |
| python-version: "3.11" | |
| - name: Set up Zig | |
| uses: goto-bus-stop/setup-zig@v2.2.1 | |
| with: | |
| version: "0.11.0" | |
| - name: Setup Go | |
| uses: actions/setup-go@v5.5.0 | |
| - name: Install Pico SDK dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential gcc wget tar | |
| - name: Create and activate a Python virtual environment | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| uv venv .venv | |
| echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
| echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Install Python dependencies | |
| run: uv pip install -r requirements.txt | |
| - run: uv pip freeze | |
| - name: Checkout pico-sdk | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| repository: raspberrypi/pico-sdk | |
| path: pico-sdk | |
| submodules: true | |
| ref: 2.2.0 | |
| - name: Checkout pico-extras | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| repository: raspberrypi/pico-extras | |
| path: pico-extras | |
| submodules: true | |
| ref: sdk-2.2.0 | |
| - name: Patch tinyusb | |
| run: | | |
| sed -i 's/OSAL_TIMEOUT_WAIT_FOREVER/OSAL_TIMEOUT_NORMAL/g' $GITHUB_WORKSPACE/pico-sdk/lib/tinyusb/src/tusb.c | |
| cat $GITHUB_WORKSPACE/pico-sdk/lib/tinyusb/src/tusb.c | grep osal_mutex | |
| - name: Set PICO_SDK_PATH | |
| run: echo "PICO_SDK_PATH=$GITHUB_WORKSPACE/pico-sdk" >> $GITHUB_ENV | |
| - name: Build zeptocore.uf2 | |
| run: | | |
| make zeptocore | |
| cp zeptocore.uf2 zeptocore_${{ github.ref_name }}.uf2 | |
| - name: Build zeptocore_128.uf2 | |
| run: | | |
| make zeptocore_128 | |
| cp zeptocore.uf2 zeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| - name: Build zeptocore_256.uf2 | |
| run: | | |
| make zeptocore_256 | |
| cp zeptocore.uf2 zeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| - name: Build ezeptocore.uf2 | |
| run: | | |
| make ezeptocore | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}.uf2 | |
| - name: Build ezeptocore_128.uf2 | |
| run: | | |
| make ezeptocore_128 | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| - name: Build ezeptocore_256.uf2 | |
| run: | | |
| make ezeptocore_256 | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| - name: Build ezeptocore no overclock | |
| run: | | |
| make ezeptocore_noclock | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| - name: Build ezeptocore no overclock 128 | |
| run: | | |
| make ezeptocore_noclock_128 | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| - name: Build ezeptocore no overclock 256 | |
| run: | | |
| make ezeptocore_noclock_256 | |
| cp ezeptocore.uf2 ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| - name: Build ectocore.uf2 | |
| run: | | |
| make ectocore | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}.uf2 | |
| - name: Build ectocore_128.uf2 | |
| run: | | |
| make ectocore_128 | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| - name: Build ectocore_256.uf2 | |
| run: | | |
| make ectocore_256 | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}_low_latency.uf2 | |
| - name: Build ectocore no overclock | |
| run: | | |
| make ectocore_noclock | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| - name: Build ectocore no overclock 128 | |
| run: | | |
| make ectocore_noclock_128 | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| - name: Build ectocore no overclock 256 | |
| run: | | |
| make ectocore_noclock_256 | |
| cp ectocore.uf2 ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| - name: Build zeptoboard.uf2 | |
| run: | | |
| make zeptoboard | |
| cp zeptoboard.uf2 zeptoboard_${{ github.ref_name }}.uf2 | |
| - name: Prepare source tarball (on tags only) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| git clone -b ${{ github.ref_name }} --depth 1 https://github.com/schollz/_core _core-${{ github.ref_name }} | |
| cd _core-${{ github.ref_name }}/core && go mod tidy && go mod vendor | |
| cd ../.. && tar -czvf _core_${{ github.ref_name }}_src.tar.gz _core-${{ github.ref_name }} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-builds | |
| path: | | |
| zeptocore_${{ github.ref_name }}.uf2 | |
| zeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| zeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| zeptoboard_${{ github.ref_name }}.uf2 | |
| ezeptocore_${{ github.ref_name }}.uf2 | |
| ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| ezeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| ezeptocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| ectocore_${{ github.ref_name }}.uf2 | |
| ectocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| ectocore_${{ github.ref_name }}_low_latency.uf2 | |
| ectocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| _core_${{ github.ref_name }}_src.tar.gz | |
| if-no-files-found: ignore | |
| release: | |
| name: Create GitHub Release (on tags) | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: firmware-builds | |
| path: ./dist | |
| - name: List artifacts | |
| run: ls -l ./dist | |
| - name: Create Release and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist/_core_${{ github.ref_name }}_src.tar.gz | |
| dist/zeptocore_${{ github.ref_name }}.uf2 | |
| dist/zeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| dist/zeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| dist/zeptoboard_${{ github.ref_name }}.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}_low_latency.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| dist/ezeptocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| dist/ectocore_${{ github.ref_name }}.uf2 | |
| dist/ectocore_${{ github.ref_name }}_ultralow_latency.uf2 | |
| dist/ectocore_${{ github.ref_name }}_low_latency.uf2 | |
| dist/ectocore_${{ github.ref_name }}_no_overclocking.uf2 | |
| dist/ectocore_${{ github.ref_name }}_no_overclocking_ultralow_latency.uf2 | |
| dist/ectocore_${{ github.ref_name }}_no_overclocking_low_latency.uf2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |