-
Notifications
You must be signed in to change notification settings - Fork 14
108 lines (106 loc) · 3.24 KB
/
build-and-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
name: build-and-release
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
build-macos:
name: build ${{ matrix.architecture }}
runs-on: macos-latest
strategy:
matrix:
architecture: [aarch64-apple-darwin, x86_64-apple-darwin]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{matrix.architecture}}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.architecture }}
- name: Save library
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.architecture }}-siera
path: target/${{ matrix.architecture }}/release/siera
build-linux:
name: build linux
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update
- run: sudo apt-get upgrade
- run: sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev
- uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Save library
uses: actions/upload-artifact@v3
with:
name: linux-siera
path: target/release/siera
build-debian:
name: build debian
# We disable this build as we can not use `cargo deb` with workspace metadata
# inheritance. For now, the generic linux build must be used.
if: false
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.version.outputs.VERSION}}
steps:
- run: sudo apt-get update
- run: sudo apt-get upgrade
- run: sudo apt-get install libssl-dev pkg-config libxcb-shape0-dev libxcb-xfixes0-dev
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-deb cargo-get
- run: cargo install cargo-deb cargo-get
- uses: actions/checkout@master
- run: cargo deb -p siera
- id: version
run: |
echo "::set-output name=VERSION::$(cargo get version)"
echo "VERSION=$(cargo get version)" >> $GITHUB_ENV
- name: Save library
uses: actions/upload-artifact@v3
with:
name: debian-siera
path: target/debian/siera_${{ env.VERSION }}_amd64.deb
build-windows:
name: build windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Save library
uses: actions/upload-artifact@v3
with:
name: windows-siera
path: target/release/siera.exe
release:
runs-on: ubuntu-latest
needs: [build-macos, build-linux, build-windows]
steps:
- name: Download built binaries
uses: actions/download-artifact@v3
- run: |
mv aarch64-apple-darwin-siera/siera apple-arm-siera
mv x86_64-apple-darwin-siera/siera apple-x86_64-siera
mv linux-siera/siera linux-x86_64-siera
mv windows-siera/siera.exe windows-x86_64-siera.exe
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
apple-arm-siera
apple-x86_64-siera
linux-x86_64-siera
windows-x86_64-siera.exe