Skip to content

Commit ba8d922

Browse files
Fix release workflow: Use GitHub CLI directly for release creation
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent 31284f6 commit ba8d922

1 file changed

Lines changed: 62 additions & 74 deletions

File tree

.github/workflows/release.yml

Lines changed: 62 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ jobs:
4747
- name: Build release binary
4848
run: cargo build --release --verbose
4949

50-
- name: Run tests
51-
run: cargo test --release --verbose
52-
5350
- name: Build .deb package
5451
run: |
5552
chmod +x build-deb.sh
@@ -62,22 +59,19 @@ jobs:
6259
echo "=== DEB Package ==="
6360
ls -la rax_*.deb
6461
65-
- name: Upload binary artifact
62+
- name: Upload binary
6663
uses: actions/upload-artifact@v4
6764
with:
6865
name: rax-binary
6966
path: target/release/rax
7067
retention-days: 30
71-
if-no-files-found: error
7268

73-
- name: Upload deb artifact
69+
- name: Upload deb package
7470
uses: actions/upload-artifact@v4
7571
with:
7672
name: rax-deb-package
77-
path: |
78-
rax_0.1.0_amd64.deb
73+
path: rax_0.1.0_amd64.deb
7974
retention-days: 30
80-
if-no-files-found: error
8175

8276
release:
8377
name: Create GitHub Release
@@ -86,73 +80,67 @@ jobs:
8680
if: startsWith(github.ref, 'refs/tags/')
8781

8882
steps:
89-
- name: Download binary artifact
83+
- name: Download artifacts
9084
uses: actions/download-artifact@v4
9185
with:
92-
name: rax-binary
9386
path: ./artifacts
9487

95-
- name: Download deb artifact
96-
uses: actions/download-artifact@v4
97-
with:
98-
name: rax-deb-package
99-
path: ./artifacts
100-
101-
- name: List artifacts for release
88+
- name: List artifacts
10289
run: |
103-
echo "=== Artifacts to upload ==="
104-
ls -la ./artifacts/
105-
106-
- name: Create Release
107-
id: create_release
108-
uses: softprops/action-gh-release@v2
109-
with:
110-
tag_name: ${{ github.ref_name }}
111-
name: Release ${{ github.ref_name }}
112-
draft: false
113-
prerelease: false
114-
fail_on_unmatched_files: true
115-
files: |
116-
./artifacts/rax
117-
./artifacts/rax_0.1.0_amd64.deb
118-
body: |
119-
## 🚀 Rax CLI ${{ github.ref_name }}
120-
121-
### Installation
122-
123-
#### Option 1: Using apt (Recommended)
124-
```bash
125-
# Add the repository
126-
curl -fsSL https://raxcore-dev.github.io/rax-offline-cli/repo.key | sudo gpg --dearmor -o /usr/share/keyrings/rax-archive-keyring.gpg
127-
echo "deb [signed-by=/usr/share/keyrings/rax-archive-keyring.gpg] https://raxcore-dev.github.io/rax-offline-cli/ /" | sudo tee /etc/apt/sources.list.d/rax.list
128-
sudo apt update
129-
sudo apt install rax
130-
```
131-
132-
#### Option 2: Direct download
133-
```bash
134-
# Download and install the .deb package
135-
wget https://github.com/Raxcore-dev/rax-offline-cli/releases/download/${{ github.ref_name }}/rax_0.1.0_amd64.deb
136-
sudo apt install ./rax_0.1.0_amd64.deb
137-
```
138-
139-
#### Option 3: Binary
140-
```bash
141-
# Download and run directly
142-
wget https://github.com/Raxcore-dev/rax-offline-cli/releases/download/${{ github.ref_name }}/rax
143-
chmod +x rax
144-
./rax
145-
```
146-
147-
### What's New
148-
- Automated build with GitHub Actions
149-
- Official apt repository support
150-
- Improved first-run experience
151-
- Persistent chat history
152-
153-
### Features
154-
- 🤖 Claude Code-style interface
155-
- 💾 Auto-saving chat history
156-
- 📁 Project context awareness
157-
- 🎨 Beautiful TUI mode
158-
- 🔒 100% offline AI
90+
echo "=== Downloaded artifacts ==="
91+
find ./artifacts -type f
92+
ls -la ./artifacts/*/
93+
94+
- name: Create or update release with assets
95+
env:
96+
GH_TOKEN: ${{ github.token }}
97+
TAG: ${{ github.ref_name }}
98+
run: |
99+
# Create release if it doesn't exist
100+
gh release create "$TAG" \
101+
--title "Release $TAG" \
102+
--notes "## 🚀 Rax CLI $TAG
103+
104+
### Installation
105+
106+
#### Option 1: Using apt (Recommended)
107+
\`\`\`bash
108+
curl -fsSL https://raxcore-dev.github.io/rax-offline-cli/repo.key | sudo gpg --dearmor -o /usr/share/keyrings/rax-archive-keyring.gpg
109+
echo \"deb [signed-by=/usr/share/keyrings/rax-archive-keyring.gpg] https://raxcore-dev.github.io/rax-offline-cli/ /\" | sudo tee /etc/apt/sources.list.d/rax.list
110+
sudo apt update
111+
sudo apt install rax
112+
\`\`\`
113+
114+
#### Option 2: Direct download
115+
\`\`\`bash
116+
wget https://github.com/Raxcore-dev/rax-offline-cli/releases/download/$TAG/rax_0.1.0_amd64.deb
117+
sudo apt install ./rax_0.1.0_amd64.deb
118+
\`\`\`
119+
120+
#### Option 3: Binary
121+
\`\`\`bash
122+
wget https://github.com/Raxcore-dev/rax-offline-cli/releases/download/$TAG/rax
123+
chmod +x rax
124+
./rax
125+
\`\`\`
126+
127+
### Features
128+
- 🤖 Claude Code-style interface
129+
- 💾 Auto-saving chat history
130+
- 📁 Project context awareness
131+
- 🎨 Beautiful TUI mode
132+
- 🔒 100% offline AI" \
133+
--draft=false \
134+
|| echo "Release already exists"
135+
136+
# Upload binary
137+
if [ -f "./artifacts/rax-binary/rax" ]; then
138+
gh release upload "$TAG" ./artifacts/rax-binary/rax --clobber
139+
fi
140+
141+
# Upload deb package
142+
if [ -f "./artifacts/rax-deb-package/rax_0.1.0_amd64.deb" ]; then
143+
gh release upload "$TAG" ./artifacts/rax-deb-package/rax_0.1.0_amd64.deb --clobber
144+
fi
145+
146+
echo "✅ Release assets uploaded successfully!"

0 commit comments

Comments
 (0)