Skip to content

Commit 9c2f96e

Browse files
add rust-cache to CI and release workflows, fix release artifact upload
1 parent 02805ea commit 9c2f96e

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- uses: dtolnay/rust-toolchain@stable
19+
- uses: Swatinem/rust-cache@v2
1920
- run: cargo test --verbose
2021
- run: cargo clippy --all-targets -- -D warnings
2122
- run: cargo fmt -- --check

.github/workflows/release.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ jobs:
6767
runs-on: ${{ matrix.os }}
6868
steps:
6969
- uses: actions/checkout@v4
70-
7170
- uses: dtolnay/rust-toolchain@stable
7271
with:
7372
targets: ${{ matrix.target }}
73+
- uses: Swatinem/rust-cache@v2
7474

7575
- name: Install musl-tools
7676
if: matrix.os == 'ubuntu-latest'
@@ -107,8 +107,14 @@ jobs:
107107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108108
run: |
109109
VERSION="${{ needs.check-version.outputs.version }}"
110-
gh release create "v$VERSION" \
111-
--title "v$VERSION" \
112-
--generate-notes \
113-
artifacts/*/* \
114-
|| echo "Release already exists"
110+
if gh release view "v$VERSION" &>/dev/null; then
111+
echo "Release v$VERSION already exists — skipping"
112+
exit 0
113+
fi
114+
shopt -s nullglob
115+
ASSETS=(artifacts/*/*)
116+
if [ ${#ASSETS[@]} -eq 0 ]; then
117+
gh release create "v$VERSION" --title "v$VERSION" --generate-notes
118+
else
119+
gh release create "v$VERSION" --title "v$VERSION" --generate-notes "${ASSETS[@]}"
120+
fi

0 commit comments

Comments
 (0)