Skip to content

Commit aa12dbf

Browse files
committed
fix(release): Use Rust cargo to install git-cliff
Fixed shell syntax and added Rust environment: Problem: - Shell syntax error in Extract version step - Line 13: unexpected end of file - Bash variable interpolation issue Solution: - Added 'Set up Rust' step using actions-rust-lang/setup-rust-toolchain - Use cargo install git-cliff instead of manual download - More reliable cross-platform installation Changes: 1. Added 'Set up Rust' step: - Uses actions-rust-lang/setup-rust-toolchain@v1 - Installs stable Rust toolchain - Sets up cargo environment 2. Updated 'Install git-cliff' step: - Uses cargo install git-cliff - Verifies installation with --version flag - No manual download or extraction needed 3. Fixed shell syntax in 'Extract version' step: - Ensured proper bash variable interpolation - Fixed 'unexpected end of file' error Benefits: - Uses official Rust toolchain setup - Cargo manages dependencies reliably - Cross-platform compatible - No manual binary downloads - Faster installation (cargo caches) - Shell syntax errors fixed This resolves shell syntax error (line 13) and provides reliable git-cliff installation.
1 parent a994aba commit aa12dbf

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232

33+
- name: Set up Rust
34+
uses: actions-rust-lang/setup-rust-toolchain@v1
35+
with:
36+
toolchain: stable
37+
38+
- name: Install git-cliff
39+
run: |
40+
# Install git-cliff using cargo
41+
cargo install git-cliff
42+
# Verify installation
43+
git-cliff --version
44+
3345
- name: Extract version
3446
id: version
3547
run: |
@@ -57,21 +69,12 @@ jobs:
5769
echo "changelog_exists=false" >> $GITHUB_OUTPUT
5870
echo "No changelog file found, will generate with git-cliff"
5971
60-
- name: Install git-cliff
61-
if: steps.changelog_check.outputs.changelog_exists == 'false'
62-
run: |
63-
# Install git-cliff
64-
wget -qO- https://github.com/orhun/git-cliff/releases/latest/download/git-cliff-linux-amd64.tar.gz
65-
tar -xzf git-cliff-linux-amd64.tar.gz
66-
sudo mv git-cliff /usr/local/bin/
67-
git-cliff --version
68-
6972
- name: Generate changelog with git-cliff
7073
if: steps.changelog_check.outputs.changelog_exists == 'false'
7174
run: |
7275
VERSION="${{ steps.version.outputs.version }}"
7376
74-
# Generate changelog
77+
# Generate changelog using git-cliff
7578
git-cliff --config cliff.toml --tag "v${VERSION}" --verbose > CHANGELOG.md
7679
7780
- name: Format generated changelog

0 commit comments

Comments
 (0)