-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 1.65 KB
/
Copy pathrelease_core.yml
File metadata and controls
62 lines (56 loc) · 1.65 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
name: release-core
on:
push:
tags:
- "v*"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
jobs:
publish-core:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Verify tag is on main
run: git branch --remote --contains "${GITHUB_SHA}" | grep -qx ' origin/main'
- name: Verify tag matches workspace version
run: |
expected="${GITHUB_REF_NAME#v}"
actual="$(awk '
/^\[workspace\.package\]/ { in_section=1; next }
/^\[/ && in_section { exit }
in_section && /^version = "/ {
gsub(/^version = "/, "", $0)
gsub(/"$/, "", $0)
print
exit
}
' Cargo.toml)"
test "${expected}" = "${actual}"
- name: Verify lockfile
run: cargo metadata --locked --format-version 1 >/dev/null
- name: Test core package
run: |
cargo test -p fastmulp-core --lib --tests --examples --locked
cargo test -p fastmulp-core --doc --locked
- name: Package core crate
run: cargo package -p fastmulp-core --locked --list
- name: Publish dry run
run: cargo publish -p fastmulp-core --locked --dry-run
- name: Publish fastmulp-core
run: cargo publish -p fastmulp-core --locked