-
-
Notifications
You must be signed in to change notification settings - Fork 543
66 lines (63 loc) · 1.89 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (63 loc) · 1.89 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
name: Release
on:
push:
tags: [v*]
jobs:
build:
name: Build (${{ matrix.target }})
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: shimmy
artifact: shimmy-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: shimmy.exe
artifact: shimmy-windows-x86_64.exe
- os: macos-latest
target: aarch64-apple-darwin
binary: shimmy
artifact: shimmy-macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }} --features airframe,huggingface
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/release/${{ matrix.binary }}
release:
name: Create Release
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-files
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p dist
find release-files -type f -exec cp {} dist/ \;
if gh release view ${{ github.ref_name }} > /dev/null 2>&1; then
gh release upload ${{ github.ref_name }} dist/* --clobber
else
gh release create ${{ github.ref_name }} dist/* \
--title "Shimmy ${{ github.ref_name }}" \
--generate-notes
fi
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish || true