Repository navigation
160 lines (154 loc) · 5.47 KB
/
Copy pathrelease.yml
File metadata and controls
160 lines (154 loc) · 5.47 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
publish-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: |
set -euo pipefail
mkdir -p .cargo
{
echo '[patch.crates-io]'
find packages -name Cargo.toml -not -path '*/target/*' -print0 |
sort -z |
while IFS= read -r -d '' manifest; do
name=$(sed -n 's/^name = "\([^"]*\)"/\1/p' "$manifest" | head -1)
directory=$(dirname "$manifest")
printf '%s = { path = "../%s" }\n' "$name" "${directory#./}"
done
} > .cargo/config.toml
find packages -name Cargo.toml -print0 |
sort -z |
while IFS= read -r -d '' manifest; do
cargo publish --dry-run --manifest-path "$manifest"
done
release-foundations:
needs: publish-dry-run
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
manifest:
- packages/aqc-file-engine-core/Cargo.toml
- packages/aqc-filetree/Cargo.toml
- packages/aqc-fs-utils/Cargo.toml
- packages/aqc-git-helpers/Cargo.toml
- packages/source/rust/aqc-rust-syntax/Cargo.toml
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: release-plz/action@v0.5
with:
manifest_path: ${{ matrix.manifest }}
config: release-plz.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release-format-cores:
needs: release-foundations
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
manifest:
- packages/file-types/toml/aqc-toml-engine-core/Cargo.toml
- packages/file-types/json/aqc-json-engine-core/Cargo.toml
- packages/file-types/yaml/aqc-yaml-engine-core/Cargo.toml
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Wait for file-engine core on crates.io
run: |
set -euo pipefail
version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' packages/aqc-file-engine-core/Cargo.toml | head -1)
for attempt in $(seq 1 30); do
cargo info "aqc-file-engine-core@$version" >/dev/null 2>&1 && exit 0
sleep 10
done
echo "aqc-file-engine-core@$version did not become available" >&2
exit 1
- uses: release-plz/action@v0.5
with:
manifest_path: ${{ matrix.manifest }}
config: release-plz.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
release-file-engines:
needs: release-format-cores
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
manifest:
- packages/file-types/text/aqc-text-file-engine/Cargo.toml
- packages/file-types/toml/aqc-cargo-toml-engine/Cargo.toml
- packages/file-types/toml/aqc-clippy-toml-engine/Cargo.toml
- packages/file-types/toml/aqc-deny-toml-engine/Cargo.toml
- packages/file-types/toml/aqc-rust-toolchain-toml-engine/Cargo.toml
- packages/file-types/toml/aqc-rustfmt-toml-engine/Cargo.toml
- packages/file-types/json/aqc-package-json-engine/Cargo.toml
- packages/file-types/json/aqc-json-file-engine/Cargo.toml
- packages/file-types/jsonc/aqc-tsconfig-json-engine/Cargo.toml
- packages/file-types/yaml/aqc-pnpm-workspace-yaml-engine/Cargo.toml
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Wait for engine cores on crates.io
run: |
set -euo pipefail
for manifest in \
packages/aqc-file-engine-core/Cargo.toml \
packages/file-types/toml/aqc-toml-engine-core/Cargo.toml \
packages/file-types/json/aqc-json-engine-core/Cargo.toml \
packages/file-types/yaml/aqc-yaml-engine-core/Cargo.toml; do
name=$(sed -n 's/^name = "\([^"]*\)"/\1/p' "$manifest" | head -1)
version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' "$manifest" | head -1)
available=false
for attempt in $(seq 1 30); do
if cargo info "$name@$version" >/dev/null 2>&1; then
available=true
break
fi
sleep 10
done
if [ "$available" != true ]; then
echo "$name@$version did not become available" >&2
exit 1
fi
done
- uses: release-plz/action@v0.5
with:
manifest_path: ${{ matrix.manifest }}
config: release-plz.toml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}