Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- run: rustup component add rustfmt --toolchain ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check

clippy:
name: Run lints
runs-on: ubuntu-latest
Expand All @@ -36,12 +37,13 @@ jobs:
- run: rustup component add clippy rustfmt --toolchain ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features

build_and_test:
name: Build project and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
toolchain:
- stable
steps:
Expand All @@ -50,17 +52,17 @@ jobs:
- run: rustup component add rustfmt --toolchain ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo test --verbose

build_release:
name: Build project in release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-latest, macos-15-intel]
toolchain:
- stable
steps:
- uses: actions/checkout@v6

- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: rustup component add rustfmt --toolchain ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
Expand All @@ -78,6 +80,31 @@ jobs:
compression-level: 9
path: dist/pumpkin-*

build_release_static:
name: Build static binary (musl)
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-musl]
toolchain: [stable]
steps:
- uses: actions/checkout@v6
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools
- run: rustup target add ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --target ${{ matrix.target }}
- name: Prepare static artifact
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/pumpkin dist/pumpkin-x86_64-linux-musl
- name: Upload static binary
uses: actions/upload-artifact@v5
with:
name: pumpkin-x86_64-linux-musl
path: dist/pumpkin-x86_64-linux-musl

clippy_release:
name: Run lints in release mode
runs-on: ubuntu-latest
Expand All @@ -91,10 +118,11 @@ jobs:
- run: rustup component add clippy rustfmt --toolchain ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --release --all-targets --all-features

draft_release:
permissions:
contents: write
needs: [build_release]
needs: [build_release, build_release_static]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
Expand All @@ -105,6 +133,7 @@ jobs:
pattern: "**/pumpkin-*"
path: dist/
merge-multiple: true

- name: Generate release notes
run: |
tree dist/
Expand All @@ -118,7 +147,7 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag --force nightly && git push --force origin tag nightly

- name: Draft a nightly github release
- name: Draft a nightly GitHub release
uses: softprops/action-gh-release@v2
with:
prerelease: true
Expand Down