-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (67 loc) · 1.71 KB
/
Copy pathrelease.yml
File metadata and controls
74 lines (67 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release
on:
push:
branches: ["main"]
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
packages: write
jobs:
versioning:
name: Update Version
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run TinySemVer
uses: ashvardanian/tinysemver@v2.1.1
with:
verbose: "true"
version-file: "VERSION"
update-version-in: |
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
Cargo.lock:name = "stringtape"\nversion = "(\d+\.\d+\.\d+)"
dry-run: "false"
push: "true"
create-release: "true"
github-token: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Test `std`
run: cargo test
- name: Test `no_std`
run: cargo test --no-default-features
- name: Test docs
run: cargo test --doc
publish_rust:
name: Publish to crates.io
runs-on: ubuntu-24.04
needs: [versioning, test]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "main"
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Publish to crates.io
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
dry-run: false