Fix jimtcl library issues, create universal MacOS builds of everythin… #177
  
    
      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
    
  
  
    
  | on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: write | |
| env: | |
| SKIP_RISCV: 0 | |
| SKIP_OPENOCD: 0 | |
| jobs: | |
| build_windows: | |
| name: Build Windows | |
| runs-on: 'windows-latest' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| - name: Build | |
| run: | | |
| subst P: . | |
| P: | |
| ./build.ps1 ./config/x64-win.json -SkipSigning -MSYS2Path (msys2 -c 'cygpath -m /').TrimEnd('\/') | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tools-win-${{ runner.arch }} | |
| path: | | |
| bin/picotool-*-x64-win.zip | |
| bin/pico-sdk-tools-*-x64-win.zip | |
| bin/openocd-*-x64-win.zip | |
| bin/riscv-toolchain-*-x64-win.zip | |
| - name: Add Release Asset | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| bin/picotool-*-x64-win.zip | |
| bin/pico-sdk-tools-*-x64-win.zip | |
| bin/openocd-*-x64-win.zip | |
| bin/riscv-toolchain-*-x64-win.zip | |
| build_macos: | |
| name: Build MacOS | |
| runs-on: 'macos-14' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up arm64 Homebrew | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@master | |
| - name: Build arm64 | |
| run: ./build_macos.sh | |
| - name: Uninstall arm64 Homebrew | |
| run: | | |
| NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" | |
| rm -rf /opt/homebrew || true | |
| - name: Set up x86_64 Homebrew | |
| run: | | |
| NONINTERACTIVE=1 arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
| - name: Install x86_64 pkg-config & cmake | |
| run: | | |
| arch -x86_64 /usr/local/bin/brew install pkg-config cmake | |
| - name: Build x86_64 | |
| run: arch -x86_64 ./build_macos.sh | |
| - name: Merge Universal Binaries | |
| run: ./merge_macos.sh | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tools-mac-universal | |
| path: | | |
| bin/picotool-*-mac.zip | |
| bin/pico-sdk-tools-*-mac.zip | |
| bin/openocd-*-mac.zip | |
| bin/riscv-toolchain-*-mac.zip | |
| - name: Add Release Asset | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| bin/picotool-*-mac.zip | |
| bin/pico-sdk-tools-*-mac.zip | |
| bin/openocd-*-mac.zip | |
| bin/riscv-toolchain-*-mac.zip | |
| build_linux: | |
| name: Build Linux | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, [self-hosted, linux, arm64, bookworm, 8G]] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build | |
| run: ./build_linux.sh | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tools-lin-${{ runner.arch }} | |
| path: | | |
| bin/picotool-*-lin.tar.gz | |
| bin/pico-sdk-tools-*-lin.tar.gz | |
| bin/openocd-*-lin.tar.gz | |
| bin/riscv-toolchain-*-lin.tar.gz | |
| - name: Add Release Asset | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| bin/picotool-*-lin.tar.gz | |
| bin/pico-sdk-tools-*-lin.tar.gz | |
| bin/openocd-*-lin.tar.gz | |
| bin/riscv-toolchain-*-lin.tar.gz | |
| test_binaries: | |
| name: Test Binaries | |
| needs: [build_linux, build_macos, build_windows] | |
| if: always() && contains(needs.*.result, 'success') | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Test all GitHub supported versions, except for windows-11-arm | |
| os: [macos-15, macos-15-intel, macos-14, windows-2025, windows-2022, windows-11-arm, ubuntu-24.04, ubuntu-22.04, ubuntu-24.04-arm, ubuntu-22.04-arm, [self-hosted, linux, arm64, trixie_desktop], [self-hosted, linux, arm64, bookworm_desktop]] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Download build (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/download-artifact@v5 | |
| with: | |
| # Only built for x64, but arm should still run it fine | |
| name: tools-win-X64 | |
| - name: Download build (MacOS) | |
| if: runner.os == 'macOS' | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: tools-mac-universal | |
| - name: Download build (Linux) | |
| if: runner.os == 'Linux' | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: tools-lin-${{ runner.arch }} | |
| - name: Extract build (zip) | |
| if: runner.os == 'Windows' || runner.os == 'macOS' | |
| shell: bash # Windows only has unzip in bash shell | |
| run: | | |
| unzip -o pico-sdk-tools*.zip | |
| ls | |
| unzip -o picotool*.zip | |
| ls | |
| unzip -o openocd*.zip || true | |
| ls | |
| unzip -o riscv-toolchain*.zip || true | |
| ls | |
| - name: Extract build (tar.gz) | |
| if: runner.os == 'Linux' | |
| run: | | |
| tar -xvf pico-sdk-tools*.tar.gz | |
| ls | |
| tar -xvf picotool*.tar.gz | |
| ls | |
| tar -xvf openocd*.tar.gz || true | |
| ls | |
| tar -xvf riscv-toolchain*.tar.gz || true | |
| ls | |
| - name: Clean runner (MacOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" | |
| - name: Install prerequisites (Ubuntu) | |
| if: runner.os == 'Linux' && runner.environment == 'github-hosted' | |
| run: sudo apt install libftdi1-2 libhidapi-hidraw0 | |
| - name: Test default stuff runs | |
| run: | | |
| ./picotool/picotool version | |
| ./pioasm/pioasm --version | |
| - name: Test openocd runs | |
| if: env.SKIP_OPENOCD != 1 | |
| run: | | |
| ./openocd --version | |
| - name: Test riscv-toolchain runs | |
| if: env.SKIP_RISCV != 1 | |
| run: | | |
| ./bin/riscv32-unknown-elf-gcc --version | |
| ./bin/riscv32-unknown-elf-gdb --version | |