-
Notifications
You must be signed in to change notification settings - Fork 8
114 lines (97 loc) · 3.08 KB
/
release-server.yml
File metadata and controls
114 lines (97 loc) · 3.08 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
name: Release Server Binaries
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
build-server:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact_name: nyro-server-linux-x86_64
binary_name: nyro-server
- os: ubuntu-24.04-arm
artifact_name: nyro-server-linux-aarch64
binary_name: nyro-server
- os: macos-15-intel
artifact_name: nyro-server-macos-x86_64
binary_name: nyro-server
- os: macos-latest
artifact_name: nyro-server-macos-aarch64
binary_name: nyro-server
- os: windows-latest
artifact_name: nyro-server-windows-x86_64.exe
binary_name: nyro-server.exe
- os: windows-11-arm
artifact_name: nyro-server-windows-arm64.exe
binary_name: nyro-server.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install frontend dependencies
run: pnpm -C webui install --frozen-lockfile
- name: Build webui
run: pnpm -C webui build
- name: Build nyro-server
run: cargo build -p nyro-server --release
- name: Package binary (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p dist
cp "target/release/${{ matrix.binary_name }}" "dist/${{ matrix.artifact_name }}"
- name: Package binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Path dist -Force | Out-Null
Copy-Item "target\release\${{ matrix.binary_name }}" "dist\${{ matrix.artifact_name }}"
- name: Upload server artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: dist/${{ matrix.artifact_name }}
publish-server:
runs-on: ubuntu-latest
needs: build-server
permissions:
contents: write
steps:
- name: Download server artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: nyro-server-*
merge-multiple: true
- name: Generate SHA256SUMS
run: |
cd artifacts
sha256sum * > SHA256SUMS.txt
- name: Upload SHA256SUMS artifact
uses: actions/upload-artifact@v4
with:
name: nyro-server-sha256sums
path: artifacts/SHA256SUMS.txt
- name: Create or update GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Nyro ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: artifacts/*
replacesArtifacts: true
makeLatest: legacy