-
Notifications
You must be signed in to change notification settings - Fork 37
90 lines (86 loc) · 3.1 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
name: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
upload-assets:
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-20.04
build_tool: cross # Use https://github.com/cross-rs/cross for ARM
- target: x86_64-apple-darwin
os: macos-latest
build_tool: cargo
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
name: Install cross-compilation tools
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: oracle-core
archive: $bin-$tag-$target
target: ${{ matrix.target }}
build_tool: ${{ matrix.build_tool }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-asset-x86-ubuntu-18:
runs-on: ubuntu-latest
container: 'ubuntu:18.04'
steps:
- name: Install dependencies
run: |
apt update -y
apt install --no-install-recommends -y \
ca-certificates curl jq zip \
clang make gcc g++ libssl-dev pkg-config protobuf-compiler
- name: Install modern Git
run: |
apt install -y software-properties-common
add-apt-repository ppa:git-core/ppa
apt update -y
apt install git -y
- name: Install Github CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions/checkout@v3
- name: fit git warning of dubious ownership
run: git config --global --add safe.directory /__w/oracle-core/oracle-core
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: oracle-core
archive: $bin-$tag-$target
target: x86_64-unknown-linux-gnu
build_tool: cargo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-asset-windows:
strategy:
matrix:
include:
- target: x86_64-pc-windows-msvc
os: windows-latest
build_tool: cargo
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: vcpkg install openssl:x64-windows-static-md
- run: echo "OPENSSL_NO_VENDOR=1" | Out-File -FilePath $env:GITHUB_ENV -Append
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: oracle-core
target: ${{ matrix.target }}
build_tool: ${{ matrix.build_tool }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}