Skip to content

Add spawn_pipe_thread to capture pipe output #59

Add spawn_pipe_thread to capture pipe output

Add spawn_pipe_thread to capture pipe output #59

Workflow file for this run

name: nightly
on:
push:
branches: [main]
concurrency:
group: nightly
cancel-in-progress: true
permissions:
contents: write # needed for moving tag & editing releases
env:
PROJECT_NAME: rc
RELEASE_VERSION: nightly
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Point nightly tag to this commit
run: |
git tag -f nightly "${GITHUB_SHA}"
git push -f origin nightly
- name: Ensure 'nightly' release exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release view nightly --repo "$GITHUB_REPOSITORY" || \
gh release create nightly --repo "$GITHUB_REPOSITORY" --title "Nightly" --notes "Latest main build" --prerelease
- name: Delete old assets from nightly release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Delete existing assets to avoid conflicts
gh release view nightly --json assets --jq '.assets[].name' | xargs -I {} gh release delete-asset nightly {} --yes || true
release-apple-silicon:
runs-on: macos-15
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
- name: Build Rust Code
run: cargo build --release
- name: Create Zip Archive
run: |
zip -j "$RELEASE_VERSION-macos-aarch64.zip" target/release/$PROJECT_NAME
# NOTE: use zip -j to avoid including paths
- name: Upload Release Artifact with gh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_VERSION" "${RELEASE_VERSION}-macos-aarch64.zip#$PROJECT_NAME-${RELEASE_VERSION}-macos-aarch64.zip" --clobber
release-apple-x86:
runs-on: macos-15-intel
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
- name: Build Rust Code
run: cargo build --release
- name: Create Zip Archive
run: |
zip -j "$RELEASE_VERSION-macos-x86.zip" target/release/$PROJECT_NAME
- name: Upload Release Artifact with gh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_VERSION" "${RELEASE_VERSION}-macos-x86.zip#$PROJECT_NAME-${RELEASE_VERSION}-macos-x86.zip" --clobber
release-linux-x86:
runs-on: ubuntu-22.04
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
rustup target add x86_64-unknown-linux-musl
- name: Build Rust Code
run: cargo build --release --target x86_64-unknown-linux-musl
- name: Create Zip Archive
run: |
zip -j "$RELEASE_VERSION-linux-x86.zip" target/x86_64-unknown-linux-musl/release/$PROJECT_NAME
- name: Upload Release Artifact with gh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_VERSION" "${RELEASE_VERSION}-linux-x86.zip#$PROJECT_NAME-${RELEASE_VERSION}-linux-x86.zip" --clobber
release-linux-arm64:
runs-on: ubuntu-24.04-arm
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
rustup target add aarch64-unknown-linux-musl
- name: Build Rust Code
run: cargo build --release --target aarch64-unknown-linux-musl
- name: Create Zip Archive
run: |
zip -j "$RELEASE_VERSION-linux-arm64.zip" target/aarch64-unknown-linux-musl/release/$PROJECT_NAME
- name: Upload Release Artifact with gh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_VERSION" "${RELEASE_VERSION}-linux-arm64.zip#$PROJECT_NAME-${RELEASE_VERSION}-linux-arm64.zip" --clobber
release-windows-x86:
runs-on: ubuntu-22.04
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install gcc-mingw-w64-x86-64
run: sudo apt-get update && sudo apt-get install -y gcc-mingw-w64-x86-64
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
rustup target add x86_64-pc-windows-gnu
- name: Build Rust Code
run: cargo build --release --target x86_64-pc-windows-gnu
- name: Create Zip Archive
run: |
zip -j "$RELEASE_VERSION-windows-x86.zip" target/x86_64-pc-windows-gnu/release/$PROJECT_NAME.exe
- name: Upload Release Artifact with gh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_VERSION" "${RELEASE_VERSION}-windows-x86.zip#$PROJECT_NAME-${RELEASE_VERSION}-windows-x86.zip" --clobber
release-windows-arm64:
runs-on: windows-2022
needs: prepare-release
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Add Windows ARM64 target
run: rustup target add aarch64-pc-windows-msvc
- name: Build Rust code (Windows ARM64)
run: cargo build --release --target aarch64-pc-windows-msvc
- name: Create Zip Archive
shell: pwsh
env:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
PROJECT_NAME: ${{ env.PROJECT_NAME }}
run: |
$zipName = "$env:RELEASE_VERSION-windows-arm64.zip"
$exePath = "target\aarch64-pc-windows-msvc\release\$env:PROJECT_NAME.exe"
Compress-Archive -Path $exePath -DestinationPath $zipName -Force
- name: Upload Release Artifact with gh
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
PROJECT_NAME: ${{ env.PROJECT_NAME }}
run: |
$zipName = "$env:RELEASE_VERSION-windows-arm64.zip"
$label = "$env:PROJECT_NAME-$env:RELEASE_VERSION-windows-arm64.zip"
gh release upload "$env:RELEASE_VERSION" "$zipName#$label" --clobber