Skip to content

Commit

Permalink
ci/rust: add support for testing and publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Oct 20, 2024
1 parent 45f45cc commit 648ba00
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ jobs:
name: wheels-apple
path: wheelhouse/*
create-gh-release:
name: Create GitHub Release
if: ${{ github.ref == 'refs/heads/release' }}
runs-on: ubuntu-latest
needs:
Expand All @@ -143,7 +142,6 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
# Ref: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows
publish-wheels-pypi:
name: Publish Wheels
if: ${{ github.ref == 'refs/heads/release' }}
runs-on: ubuntu-latest
needs:
Expand All @@ -168,3 +166,17 @@ jobs:
- uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
publish-crates-io:
# Refs:
# - https://github.com/azriel91/peace/blob/main/.github/workflows/publish.yml
# - https://users.rust-lang.org/t/does-anyone-use-github-actions-to-run-cargo-publish/92374
if: ${{ github.ref == 'refs/heads/release' }}
environment:
name: publish-crates-io
url: https://crates.io/crates/wtr-watcher
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/watcher-rs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test (Rust)

on:
push:
branches: [ release, next ]

env:
CARGO_TERM_COLOR: always

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }}
- run: rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose

0 comments on commit 648ba00

Please sign in to comment.