Skip to content

Commit b492729

Browse files
committed
ci: add release workflow and Dependabot configuration
Add automated release builds and dependency updates: Release workflow: - Triggered on version tags (v*.*.*) - Cross-platform builds: Linux (x86_64, aarch64), macOS (x86_64, aarch64), Windows (x86_64) - Automatic GitHub Release creation with binaries - Optimized release builds with all features Dependabot: - Weekly Cargo dependency updates (Mondays 09:00 UTC) - Weekly GitHub Actions updates (Mondays 10:00 UTC) - Grouped minor/patch updates - Automatic PR creation (max 10 Cargo, 5 Actions)
1 parent bc16b38 commit b492729

File tree

2 files changed

+172
-0
lines changed

2 files changed

+172
-0
lines changed

.github/dependabot.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 2
2+
updates:
3+
# Cargo dependencies
4+
- package-ecosystem: "cargo"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
timezone: Etc/GMT-0
11+
open-pull-requests-limit: 10
12+
labels:
13+
- "dependencies"
14+
- "rust"
15+
commit-message:
16+
prefix: "chore"
17+
include: "scope"
18+
# Group minor and patch updates
19+
groups:
20+
minor-and-patch:
21+
patterns:
22+
- "*"
23+
update-types:
24+
- "minor"
25+
- "patch"
26+
27+
# GitHub Actions
28+
- package-ecosystem: "github-actions"
29+
directory: "/"
30+
schedule:
31+
interval: "weekly"
32+
day: "monday"
33+
time: "10:00"
34+
timezone: Etc/GMT-0
35+
open-pull-requests-limit: 5
36+
labels:
37+
- "dependencies"
38+
- "github-actions"
39+
commit-message:
40+
prefix: "ci"

.github/workflows/release.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
build:
13+
name: Build Release (${{ matrix.target }})
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 45
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
target: x86_64-unknown-linux-gnu
22+
artifact_name: mcp-cli
23+
asset_name: mcp-cli-linux-amd64
24+
- os: ubuntu-latest
25+
target: aarch64-unknown-linux-gnu
26+
artifact_name: mcp-cli
27+
asset_name: mcp-cli-linux-arm64
28+
- os: macos-latest
29+
target: x86_64-apple-darwin
30+
artifact_name: mcp-cli
31+
asset_name: mcp-cli-macos-amd64
32+
- os: macos-latest
33+
target: aarch64-apple-darwin
34+
artifact_name: mcp-cli
35+
asset_name: mcp-cli-macos-arm64
36+
- os: windows-latest
37+
target: x86_64-pc-windows-msvc
38+
artifact_name: mcp-cli.exe
39+
asset_name: mcp-cli-windows-amd64.exe
40+
41+
steps:
42+
- uses: actions/checkout@v5
43+
44+
- name: Install Rust
45+
uses: dtolnay/rust-toolchain@stable
46+
with:
47+
targets: ${{ matrix.target }}
48+
49+
# Install cross-compilation tools for ARM Linux
50+
- name: Install cross-compilation tools (ARM Linux)
51+
if: matrix.target == 'aarch64-unknown-linux-gnu'
52+
run: |
53+
sudo apt-get update
54+
sudo apt-get install -y gcc-aarch64-linux-gnu
55+
56+
- name: Setup sccache
57+
uses: mozilla-actions/[email protected]
58+
59+
- name: Configure sccache
60+
shell: bash
61+
run: |
62+
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
63+
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
64+
65+
- name: Cache Cargo
66+
uses: Swatinem/rust-cache@v2
67+
with:
68+
shared-key: "release-${{ matrix.target }}"
69+
70+
- name: Build release
71+
run: cargo build --release --target ${{ matrix.target }} --package mcp-cli
72+
env:
73+
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
74+
75+
- name: Strip binary (Unix)
76+
if: matrix.os != 'windows-latest'
77+
run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
78+
79+
- name: Package binaries (Unix)
80+
if: matrix.os != 'windows-latest'
81+
run: |
82+
cd target/${{ matrix.target }}/release
83+
tar czf ../../../${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}
84+
85+
- name: Package binaries (Windows)
86+
if: matrix.os == 'windows-latest'
87+
run: |
88+
cd target/${{ matrix.target }}/release
89+
7z a ../../../${{ matrix.asset_name }}.zip ${{ matrix.artifact_name }}
90+
91+
- name: Upload artifacts
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ${{ matrix.asset_name }}
95+
path: |
96+
${{ matrix.asset_name }}.tar.gz
97+
${{ matrix.asset_name }}.zip
98+
retention-days: 7
99+
100+
release:
101+
name: Create Release
102+
needs: build
103+
runs-on: ubuntu-latest
104+
permissions:
105+
contents: write
106+
steps:
107+
- uses: actions/checkout@v5
108+
with:
109+
fetch-depth: 0
110+
111+
- name: Download artifacts
112+
uses: actions/download-artifact@v4
113+
with:
114+
path: artifacts
115+
116+
- name: Generate changelog
117+
id: changelog
118+
run: |
119+
echo "## Changes in this Release" > CHANGELOG.md
120+
echo "" >> CHANGELOG.md
121+
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s (%h)" >> CHANGELOG.md || echo "- Initial release" >> CHANGELOG.md
122+
123+
- name: Create Release
124+
uses: softprops/action-gh-release@v2
125+
with:
126+
files: artifacts/**/*
127+
body_path: CHANGELOG.md
128+
draft: false
129+
prerelease: false
130+
generate_release_notes: true
131+
env:
132+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)