-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.29 KB
/
release.yml
File metadata and controls
74 lines (65 loc) · 2.29 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]
workflow_dispatch:
inputs:
publish_only:
description: "Skip release-please, run publish directly (for retrying failed publishes)"
type: boolean
default: false
permissions:
contents: write
pull-requests: write
env:
CARGO_TERM_COLOR: always
jobs:
# ── Release Please: manages the Release PR and creates tags ──────────
release-please:
name: Release Please
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
steps:
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# ── Publish to crates.io in dependency order ─────────────────────────
# CI already passed on the Release PR via build-sdk.yml before merge.
publish:
name: Publish to crates.io
runs-on: ubuntu-latest
needs: release-please
if: |
needs.release-please.outputs.releases_created == 'true' ||
inputs.publish_only == true
environment: crates-io
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: stable
- name: Publish ans-types
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p ans-types
- name: Wait for ans-types to be available on crates.io
run: |
for i in $(seq 1 30); do
if cargo search ans-types 2>/dev/null | grep -q '^ans-types '; then
echo "ans-types is available on crates.io"
break
fi
echo "Waiting for crates.io index (attempt $i/30)..."
sleep 10
done
- name: Publish ans-verify
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p ans-verify
- name: Publish ans-client
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p ans-client