Skip to content

Add publish job to pipeline #2

Add publish job to pipeline

Add publish job to pipeline #2

Workflow file for this run

name: CI workflow
on:
push:
branches: [ "master" ]
tags: [ "*.*.*" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
publish:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Publish to crates.io
run: cargo publish --token ${CRATES_TOKEN}
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}