-
Notifications
You must be signed in to change notification settings - Fork 60
184 lines (155 loc) · 5.71 KB
/
release.yml
File metadata and controls
184 lines (155 loc) · 5.71 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
# Linux targets
- target: x86_64-unknown-linux-gnu
name: wassette
arch: linux_amd64
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
name: wassette
arch: linux_arm64
runner: ubuntu-24.04-arm
# macOS targets
- target: x86_64-apple-darwin
name: wassette
arch: darwin_amd64
runner: macos-13
- target: aarch64-apple-darwin
name: wassette
arch: darwin_arm64
runner: macos-latest
# Windows targets
- target: x86_64-pc-windows-msvc
name: wassette
arch: windows_amd64
runner: windows-latest
- target: aarch64-pc-windows-msvc
name: wassette
arch: windows_arm64
runner: windows-11-arm
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Sccache Action
if: matrix.target != 'aarch64-pc-windows-msvc'
uses: Mozilla-Actions/sccache-action@v0.0.9
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Add WASM target
run: rustup target add wasm32-wasip2
- name: Build release binary
run: cargo build --release
- name: Extract version (Unix)
if: "!contains(matrix.target, 'windows')"
id: version-unix
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Extract version (Windows)
if: contains(matrix.target, 'windows')
id: version-windows
run: |
$VERSION = "${{ github.ref_name }}" -replace '^v', ''
echo "version=$VERSION" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Set version output
id: version
run: |
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
echo "version=${{ steps.version-windows.outputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.version-unix.outputs.version }}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Prepare binary (Unix)
if: "!contains(matrix.target, 'windows')"
run: |
cd target/release
tar czvf ../../${{ matrix.name }}_${{ steps.version.outputs.version }}_${{ matrix.arch }}.tar.gz wassette
cd -
- name: Prepare binary (Windows)
if: contains(matrix.target, 'windows')
run: |
cd target/release
7z a ../../${{ matrix.name }}_${{ steps.version.outputs.version }}_${{ matrix.arch }}.zip wassette.exe
cd -
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-${{ matrix.arch }}
path: |
${{ matrix.name }}_*_${{ matrix.arch }}.tar.gz
${{ matrix.name }}_*_${{ matrix.arch }}.zip
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version
id: version
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -name "*.tar.gz" -exec cp {} release-assets/ \;
find artifacts -name "*.zip" -exec cp {} release-assets/ \;
ls -la release-assets/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
generate_release_notes: true
files: release-assets/*
body: |
## Downloads
### Linux
- [AMD64 (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_linux_amd64.tar.gz)
### macOS (Darwin)
- [AMD64/Intel (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_darwin_amd64.tar.gz)
- [ARM64/Apple Silicon (tar.gz)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_darwin_arm64.tar.gz)
### Windows
- [AMD64 (zip)](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/wassette_${{ steps.version.outputs.version }}_windows_amd64.zip)
## Install
### All Platforms (Shell Script)
```bash
curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | bash
```
This will detect your platform and install the latest `wassette` binary to your `$PATH`.
## Usage
```bash
# Start the MCP server
wassette serve --http --policy-file policy.yaml
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}