-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (112 loc) · 3.85 KB
/
Copy pathpublish-rust.yml
File metadata and controls
140 lines (112 loc) · 3.85 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Publish Rust Crates
on:
push:
tags:
- "**"
permissions:
contents: read
env:
RELEASE_VERSION: ${{ github.ref_name }}
concurrency:
group: publish-rust-${{ github.ref_name }}
cancel-in-progress: false
jobs:
version-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Validate lockstep versions against tag
run: python3 scripts/manage_versions.py check --tag "${{ env.RELEASE_VERSION }}"
package-check:
needs: version-check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Verify Rust crates package cleanly
run: cargo package --allow-dirty --manifest-path rust/Cargo.toml -p tstring-syntax -p tstring-json -p tstring-toml -p tstring-yaml
publish-syntax:
needs: package-check
runs-on: ubuntu-latest
permissions:
contents: read
environment:
name: crates-io
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Publish tstring-syntax
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty --manifest-path rust/Cargo.toml -p tstring-syntax
publish-json:
needs: publish-syntax
runs-on: ubuntu-latest
permissions:
contents: read
environment:
name: crates-io
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Wait for tstring-syntax to appear on crates.io
run: python3 .github/scripts/wait_for_crate.py tstring-syntax
- name: Publish tstring-json
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty --manifest-path rust/Cargo.toml -p tstring-json
publish-toml:
needs: publish-json
runs-on: ubuntu-latest
permissions:
contents: read
environment:
name: crates-io
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Publish tstring-toml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty --manifest-path rust/Cargo.toml -p tstring-toml
publish-yaml:
needs: publish-toml
runs-on: ubuntu-latest
permissions:
contents: read
environment:
name: crates-io
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Sync lockstep versions to release tag
run: python3 scripts/manage_versions.py set "${{ env.RELEASE_VERSION }}"
- name: Set up Rust
uses: dtolnay/rust-toolchain@1.100.0
- name: Publish tstring-yaml
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --allow-dirty --manifest-path rust/Cargo.toml -p tstring-yaml