name: Publish
on:
push:
branches:
- main
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --codecov --output-path codecov.json
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
needs:
- test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
run: rustup update stable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Release
run: |
npm install --no-save semantic-release @semantic-release/git semantic-release-cargo
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}