-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (90 loc) · 2.93 KB
/
Copy pathrelease.yml
File metadata and controls
102 lines (90 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Release version, for example v0.1.0"
required: true
type: string
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-latest
build_binary: agents
plugin_binary: agents
archive: agents-x86_64-unknown-linux-gnu.tar.gz
package: tar
- name: macos-aarch64
os: macos-14
build_binary: agents
plugin_binary: agents
archive: agents-aarch64-apple-darwin.tar.gz
package: tar
- name: windows-x86_64
os: windows-latest
build_binary: agents.exe
plugin_binary: agents.exe
archive: agents-x86_64-pc-windows-msvc.zip
package: zip
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: Swatinem/rust-cache@v2
- name: Build release binary
run: cargo build -p mesh-agents --bin agents --release --locked
- name: Package Unix archive
if: matrix.package == 'tar'
shell: bash
run: |
set -euo pipefail
mkdir -p dist/agents
cp "target/release/${{ matrix.build_binary }}" "dist/agents/${{ matrix.plugin_binary }}"
cp plugin.toml README.md LICENSE dist/agents/
cp -R skills dist/agents/skills
tar -czf "${{ matrix.archive }}" -C dist agents
- name: Package Windows archive
if: matrix.package == 'zip'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist/agents | Out-Null
Copy-Item "target/release/${{ matrix.build_binary }}" "dist/agents/${{ matrix.plugin_binary }}"
Copy-Item plugin.toml, README.md, LICENSE dist/agents/
Copy-Item skills "dist/agents/skills" -Recurse
Compress-Archive -Path "dist/agents" -DestinationPath "${{ matrix.archive }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archive }}
path: ${{ matrix.archive }}
if-no-files-found: error
publish:
name: Publish GitHub release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.version || github.ref_name }}
name: ${{ github.event.inputs.version || github.ref_name }}
files: artifacts/*
fail_on_unmatched_files: true