Repository navigation
42 lines (42 loc) · 1.59 KB
/
Copy pathrelease.yml
File metadata and controls
42 lines (42 loc) · 1.59 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
name: Publish to crates.io
on:
push:
tags:
- "v*"
- "runner_q-v*"
- "runner_q_redis-v*"
jobs:
publish:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
- uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7
- uses: rust-lang/crates-io-auth-action@63a7064947ceca9989005e118db3a5fecdc9259f
id: auth
# Tag determines which crate(s) to publish:
# runner_q_redis-v* → runner_q_redis only
# runner_q-v* → runner_q only
# v* (e.g. v0.6.5) → both (runner_q then runner_q_redis)
- name: Publish runner_q
if: ${{ (startsWith(github.ref_name, 'v') && !startsWith(github.ref_name, 'runner_q_redis-v')) || startsWith(github.ref_name, 'runner_q-v') }}
run: |
for attempt in 1 2 3 4 5; do
cargo publish -p runner_q && exit 0
[ "$attempt" -eq 5 ] && exit 1
sleep $((attempt * 15))
done
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- name: Publish runner_q_redis
if: ${{ (startsWith(github.ref_name, 'v') && !startsWith(github.ref_name, 'runner_q-v')) || startsWith(github.ref_name, 'runner_q_redis-v') }}
run: |
for attempt in 1 2 3 4 5; do
cargo publish -p runner_q_redis && exit 0
[ "$attempt" -eq 5 ] && exit 1
sleep $((attempt * 15))
done
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}