-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (67 loc) · 2.21 KB
/
release.yml
File metadata and controls
85 lines (67 loc) · 2.21 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
75
76
77
78
79
80
81
82
83
84
85
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run cargo test
run: cargo test --workspace --all-features
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update Cargo.toml version
run: |
sed -i 's/^version = ".*"/version = "${{ steps.version.outputs.VERSION }}"/' pqueue/Cargo.toml
- name: Verify version update
run: |
echo "Updated version in Cargo.toml:"
grep '^version = ' pqueue/Cargo.toml
- name: Publish to crates.io
run: cargo publish --manifest-path pqueue/Cargo.toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false
body: |
Release version ${{ steps.version.outputs.VERSION }} of concurrent-pqueue.
## What's Changed
See the [CHANGELOG](https://github.com/dwayn/pqueue/blob/main/README.md#changelog) for details.
## Installation
```toml
[dependencies]
concurrent-pqueue = "${{ steps.version.outputs.VERSION }}"
```