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
name: Release
on:
push:
tags:
# Crate releases only. The '!vscode-*' exclusion keeps the extension's own
# `vscode-v*` tags (handled by vscode-extension-release.yml) from also
# matching 'v*' and misfiring a crate release + cargo publish.
- 'v*'
- '!vscode-*'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_version: ${{ env.RELEASE_VERSION }}
steps:
- name: Get the release version from the tag
shell: bash
if: env.RELEASE_VERSION == ''
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version is: ${{ env.RELEASE_VERSION }}"
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
build-release:
name: Build Release
needs: create-release
strategy:
fail-fast: false
matrix:
build:
include:
- build: linux
os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
archive-name: omni-dev-linux.tar.gz
# Built natively on GitHub's hosted ARM64 runner (free for public
# repos) rather than cross-compiled, so the C dependencies need no
# cross linker or sysroot. `omni-dev-linux.tar.gz` stays x86_64.
- build: linux-arm64
os: ubuntu-24.04-arm
rust: stable
target: aarch64-unknown-linux-gnu
archive-name: omni-dev-linux-arm64.tar.gz
- build: macos
os: macos-latest
rust: stable
target: aarch64-apple-darwin
archive-name: omni-dev-macos-arm64.tar.gz
- build: win-msvc
os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
archive-name: omni-dev-windows.zip
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Build release binaries
run: cargo build --verbose --release --target ${{ matrix.target }} --features mcp --bin omni-dev --bin omni-dev-mcp
- name: Strip release binaries (everything but windows)
if: matrix.build != 'win-msvc'
run: |
strip "target/${{ matrix.target }}/release/omni-dev"
strip "target/${{ matrix.target }}/release/omni-dev-mcp"
- name: Build archive
shell: bash
run: |
mkdir archive
cp LICENSE README.md archive/
if [ "${{ matrix.build }}" = "win-msvc" ]; then
cp "target/${{ matrix.target }}/release/omni-dev.exe" archive/
cp "target/${{ matrix.target }}/release/omni-dev-mcp.exe" archive/
cd archive
7z a "${{ matrix.archive-name }}" *
else
cp "target/${{ matrix.target }}/release/omni-dev" archive/
cp "target/${{ matrix.target }}/release/omni-dev-mcp" archive/
cd archive
tar czf "${{ matrix.archive-name }}" *
fi
- name: Upload release archive
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: archive/${{ matrix.archive-name }}
asset_name: ${{ matrix.archive-name }}
asset_content_type: application/octet-stream
publish-crates:
name: Publish to crates.io
runs-on: ubuntu-latest
needs:
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}