Skip to content

chore: add explicit versions to workspace dependencies #9

chore: add explicit versions to workspace dependencies

chore: add explicit versions to workspace dependencies #9

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build Release (${{ matrix.target }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
contents: read
actions: write # For uploading artifacts
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: mcp-execution-cli
asset_name: mcp-execution-cli-linux-amd64
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: mcp-execution-cli
asset_name: mcp-execution-cli-linux-arm64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: mcp-execution-cli
asset_name: mcp-execution-cli-macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: mcp-execution-cli
asset_name: mcp-execution-cli-macos-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: mcp-execution-cli.exe
asset_name: mcp-execution-cli-windows-amd64.exe
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
# Install cross-compilation tools for ARM Linux
- name: Install cross-compilation tools (ARM Linux)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure sccache
shell: bash
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "release-${{ matrix.target }}"
- name: Build release
run: cargo build --release --target ${{ matrix.target }} --package mcp-execution-cli
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- name: Strip binary (Unix)
if: matrix.os != 'windows-latest'
run: |
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
else
strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
fi
- name: Package binaries (Unix)
if: matrix.os != 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
tar czf ../../../${{ matrix.asset_name }}.tar.gz ${{ matrix.artifact_name }}
- name: Package binaries (Windows)
if: matrix.os == 'windows-latest'
run: |
cd target/${{ matrix.target }}/release
7z a ../../../${{ matrix.asset_name }}.zip ${{ matrix.artifact_name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: |
${{ matrix.asset_name }}.tar.gz
${{ matrix.asset_name }}.zip
retention-days: 7
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Generate changelog
id: changelog
run: |
echo "## Changes in this Release" > CHANGELOG.md
echo "" >> CHANGELOG.md
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s (%h)" >> CHANGELOG.md || echo "- Initial release" >> CHANGELOG.md
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
body_path: CHANGELOG.md
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}