This repository was archived by the owner on Feb 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
182 lines (160 loc) · 5.31 KB
/
release.yml
File metadata and controls
182 lines (160 loc) · 5.31 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Release Binary
on:
push:
branches:
- master
jobs:
get_next_version:
runs-on: ubuntu-latest
name: Fetch next version number
steps:
- uses: actions/checkout@v2
- name: semantic release
id: semantic
uses: cycjimmy/semantic-release-action@v2
with:
dry_run: true
working_directory: .github/fetch_version
- run: echo ${{ steps.semantic.outputs.new_release_version }}
- run: echo ${{ steps.semantic.outputs.new_release_published }}
outputs:
create_release: ${{ steps.semantic.outputs.new_release_published }}
new_version: ${{ steps.semantic.outputs.new_release_version }}
build_windows:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: true
matrix:
include:
- target: x86_64-pc-windows-msvc
openssl_target: openssl:x64-windows-static-md
name: Build ${{ matrix.target }} on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: (get-content -Path .\Cargo.toml) | %{$_ -replace "version = \`"0.0.0-development\`"","version = `"${{ needs.get_next_version.outputs.new_version }}`""} | set-content -Path .\Cargo.toml
- name: install and setup vcpkg
uses: lukka/run-vcpkg@v10.1
with:
vcpkgGitCommitId: b196dacc2f63f37bb75504c36c349042336749cb
- name: setup openssl
run: vcpkg install ${{ matrix.openssl_target }}
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: upload artifacts
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby.exe
build_unix:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Build ${{ matrix.target }} on ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- name: upload artifacts
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby
build_macos:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
- target: x86_64-apple-darwin
name: Build ${{ matrix.target }} on macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: set new version number (${{ needs.get_next_version.outputs.new_version }})
run: sed -i -e 's/^version = .*/version = "${{ needs.get_next_version.outputs.new_version }}"/' Cargo.toml
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
use-cross: true
args: --release --target ${{ matrix.target }}
- name: upload artifacts
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/kuby
create_release:
needs:
- build_windows
- build_unix
- build_macos
if: needs.get_next_version.outputs.create_release == 'true'
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v7
- name: package m1 apple
uses: papeloto/action-zip@v1
with:
files: aarch64-apple-darwin/
dest: aarch64-apple-darwin.zip
- name: package intel apple
uses: papeloto/action-zip@v1
with:
files: x86_64-apple-darwin/
dest: x86_64-apple-darwin.zip
- name: package windows x64
uses: papeloto/action-zip@v1
with:
files: x86_64-pc-windows-msvc/
dest: x86_64-pc-windows-msvc.zip
- name: package unix
uses: papeloto/action-zip@v1
with:
files: x86_64-unknown-linux-gnu/
dest: x86_64-unknown-linux-gnu.zip
- name: create release
uses: cycjimmy/semantic-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}