-
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (106 loc) · 3.36 KB
/
release.yml
File metadata and controls
123 lines (106 loc) · 3.36 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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-release:
name: Build Release (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
archive: tar.gz
- os: macos-latest
target: x86_64-apple-darwin
archive: tar.gz
- os: macos-latest
target: aarch64-apple-darwin
archive: tar.gz
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install musl-tools (Linux musl)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Build release binary
run: cargo build --release --target ${{ matrix.target }}
- name: Strip binary (Linux/macOS)
run: strip target/${{ matrix.target }}/release/agentik
- name: Create archive
id: archive
shell: bash
run: |
VERSION=${GITHUB_REF#refs/tags/v}
ARCHIVE_NAME="agentik-${VERSION}-${{ matrix.target }}"
mkdir -p "${ARCHIVE_NAME}"
cp target/${{ matrix.target }}/release/agentik "${ARCHIVE_NAME}/"
cp README.md LICENSE* "${ARCHIVE_NAME}/" 2>/dev/null || true
if [ "${{ matrix.archive }}" = "tar.gz" ]; then
tar -czvf "${ARCHIVE_NAME}.tar.gz" "${ARCHIVE_NAME}"
echo "path=${ARCHIVE_NAME}.tar.gz" >> $GITHUB_OUTPUT
fi
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.target }}
path: ${{ steps.archive.outputs.path }}
if-no-files-found: error
create-release:
name: Create Release
needs: build-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: release-*
merge-multiple: true
- name: Generate checksums
run: |
cd artifacts
sha256sum *.tar.gz > checksums.sha256
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/*.tar.gz
artifacts/checksums.sha256
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional: Publish to crates.io
# publish-crates:
# name: Publish to crates.io
# needs: create-release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
#
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
#
# - name: Publish crates
# run: |
# cargo publish -p agentik-core
# cargo publish -p agentik-providers
# # ... other crates in dependency order
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}