-
Notifications
You must be signed in to change notification settings - Fork 2
126 lines (125 loc) · 3.85 KB
/
release.yml
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
name: Build Release
on:
push:
branches:
- main
tags:
- v1.*
workflow_dispatch:
inputs:
git-ref:
description: "Git Ref"
required: false
jobs:
create-source-archive:
runs-on: ubuntu-22.04
steps:
- name: Checkout (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Checkout (Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
- name: Create Source Archive
run: make source
- name: Upload Source Archive
uses: actions/upload-artifact@v4
with:
name: source-archive
path: build/kestrel-*.*.*.tar.gz
release-linux:
runs-on: ubuntu-22.04
steps:
- name: Install Build Dependencies
run: |
rustup update
rustup target add x86_64-unknown-linux-musl
rustup target add aarch64-unknown-linux-musl
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu rpm
- name: Checkout (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Checkout (Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
- name: Build Release
run: make all-linux
- name: Upload Release Archive
uses: actions/upload-artifact@v4
with:
name: release-linux
path: build/release-linux-*.tar.gz
release-macos:
runs-on: macos-latest
steps:
- name: Install Build Dependencies
run: |
rustup update
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Checkout (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Checkout (Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
- name: Build Release
run: make all-macos
- name: Upload Release Archive
uses: actions/upload-artifact@v4
with:
name: release-macos
path: build/release-macos-*.tar.gz
release-windows:
runs-on: windows-latest
steps:
- name: Install Build Dependencies
run: |
rustup update
rustup target add x86_64-pc-windows-msvc
- name: Checkout (Latest)
uses: actions/checkout@v4
if: github.event.inputs.git-ref == ''
- name: Checkout (Ref)
uses: actions/checkout@v4
if: github.event.inputs.git-ref != ''
- name: Build Release
run: |
.\windows-build.ps1 all
shell: pwsh
- name: Upload Release Archive
uses: actions/upload-artifact@v4
with:
name: release-windows
path: build/release-windows-*.zip
combine-artifacts:
runs-on: ubuntu-22.04
needs: [
create-source-archive,
release-linux,
release-macos,
release-windows
]
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Extract Files
run: |
tar -C release-linux -xf release-linux/release-linux-*.tar.gz
tar -C release-macos -xf release-macos/release-macos-*.tar.gz
unzip release-windows/release-windows-*.zip -d release-windows
- name: Create Combined Release
run: |
mkdir release-all
cp -a release-linux/release-linux-*/* release-all/
cp -a release-macos/release-macos-*/* release-all/
cp release-windows/release-windows-*/* release-all/
cp -a source-archive/kestrel-*.*.*.tar.gz release-all/
cd release-all && sha256sum -b * > SHA256SUMS.txt && cd ..
tar -czvpf release-all.tar.gz release-all
- name: Upload Release Archive
uses: actions/upload-artifact@v4
with:
name: release-all
path: release-all.tar.gz