Add windows release for rust nodes #929
This file contains 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: node-hub | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: [published] | |
jobs: | |
find-jobs: | |
runs-on: ubuntu-22.04 | |
name: Find Jobs | |
outputs: | |
folders: ${{ steps.jobs.outputs.folders }} | |
steps: | |
- uses: actions/checkout@v1 | |
- id: jobs | |
uses: kmanimaran/list-folder-action@v4 | |
with: | |
path: ./node-hub | |
ci: | |
runs-on: ${{ matrix.platform }} | |
needs: [find-jobs] | |
defaults: | |
run: | |
working-directory: node-hub/${{ matrix.folder }} | |
strategy: | |
fail-fast: ${{ github.event_name != 'workflow_dispatch' && !(github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) }} | |
matrix: | |
platform: [ubuntu-22.04, macos-14] | |
folder: ${{ fromJson(needs.find-jobs.outputs.folders )}} | |
steps: | |
- name: Checkout repository | |
if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Make sure to check out the sub-module | |
- name: Update submodule | |
if: runner.os == 'Linux' | |
run: | | |
git submodule update --init --recursive | |
git submodule update --remote --recursive | |
- name: Install system-level dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install portaudio19-dev | |
# Install mingw-w64 cross-compilers | |
sudo apt install g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 | |
- name: Install system-level dependencies for MacOS | |
if: runner.os == 'MacOS' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/'))) | |
run: | | |
brew install portaudio | |
- name: Set up Python | |
if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Set up Rust | |
if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run Linting and Tests | |
## Run Linting and testing only on Mac for release workflows. | |
if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) | |
env: | |
GITHUB_EVENT_NAME: ${{ github.event_name }} | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASS }} | |
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASS }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: | | |
chmod +x ../../.github/workflows/node_hub_test.sh | |
../../.github/workflows/node_hub_test.sh |