Skip to content

Commit e2a521e

Browse files
chore: Speed up CI by caching Sampo
1 parent 473796e commit e2a521e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,13 @@ jobs:
3131
ref: master
3232
fetch-depth: 0
3333

34-
- name: Install Rust
35-
uses: dtolnay/rust-toolchain@0b1efabc08b657293548b77fb76cc02d26091c7e
36-
with:
37-
toolchain: 1.91.1
38-
components: cargo
39-
40-
- name: Install Sampo CLI
41-
run: cargo install sampo
42-
4334
- name: Check release conditions
4435
id: check
4536
run: |
46-
if sampo release --dry-run; then
37+
changeset_count=$(find .sampo/changesets -name '*.md' 2>/dev/null | wc -l)
38+
if [ "$changeset_count" -gt 0 ]; then
4739
echo "should-release=true" >> "$GITHUB_OUTPUT"
48-
echo "Changesets found, ready to release"
40+
echo "Found $changeset_count changeset(s), ready to release"
4941
else
5042
echo "should-release=false" >> "$GITHUB_OUTPUT"
5143
echo "No changesets to release"
@@ -112,7 +104,15 @@ jobs:
112104
toolchain: 1.91.1
113105
components: cargo
114106

107+
- name: Cache Sampo CLI
108+
id: cache-sampo
109+
uses: actions/cache@v3
110+
with:
111+
path: ~/.cargo/bin/sampo
112+
key: sampo-${{ runner.os }}-${{ runner.arch }}
113+
115114
- name: Install Sampo CLI
115+
if: steps.cache-sampo.outputs.cache-hit != 'true'
116116
run: cargo install sampo
117117

118118
- name: Install Hex dependencies

0 commit comments

Comments
 (0)