Skip to content

Commit bd3bd09

Browse files
authored
ci: add publish to crates.io (#6)
1 parent 8592e7e commit bd3bd09

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

.github/workflows/cd.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CD
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
12+
13+
- uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
14+
15+
- name: Update version from tag
16+
run: |
17+
VERSION=${GITHUB_REF#refs/tags/v}
18+
sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
19+
20+
- name: Publish to crates.io
21+
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3333

34-
- uses: dtolnay/rust-toolchain@stable
34+
- uses: dtolnay/rust-toolchain@4305c38b25d97ef35a8ad1f985ccf2d2242004f2 # stable
3535

3636
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
3737
with:

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[package]
22
name = "zerv"
3-
version = "0.1.0"
3+
version = "0.0.0" # Use git tag
44
edition = "2024"
5+
description = "Dynamic Versioning CLI"
6+
license = "Apache-2.0"
7+
repository = "https://github.com/wisarootl/zerv"
58

69
[[bin]]
710
name = "zerv"

0 commit comments

Comments
 (0)