Skip to content

Commit

Permalink
added publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Oct 22, 2024
1 parent ff88478 commit 406245f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/crate-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Main

on:
push:

env:
CARGO_TERM_COLOR: always

jobs:
build-test:
name: Build and test (${{ matrix.os }})

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo build --verbose
- run: cargo test --verbose

publish:
name: Publish to crates.io
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Publish
# https://doc.rust-lang.org/cargo/reference/config.html?highlight=CARGO_REGISTRY_TOKEN#credentials
- - run: rustup update stable && rustup default stable
- run: >
cargo publish
--dry-run
--verbose
--locked
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 406245f

Please sign in to comment.