-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 3.22 KB
/
cli-tools-build.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
name: Build Tools CLI
on:
workflow_dispatch:
inputs:
pkg_version:
description: 'Arbitrary release version'
required: false
default: '1.0.0'
pkg_arch:
description: 'Target triplet (x86_64-pc-windows-gnu, x86_64-unknown-linux-gnu, etc)'
required: true
default: 'x86_64-pc-windows-gnu'
mingw_arch:
description: 'Target MinGW architecture (x86-64, i686)'
required: true
default: 'x86-64'
jobs:
build-win:
if: ${{ contains(github.event.inputs.pkg_arch, '-windows-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{github.event.inputs.pkg_arch}}
- name: Setup MinGW
run: sudo apt-get install -y gcc-mingw-w64-${{github.event.inputs.mingw_arch}}
- name: Setup OpenSSL (64-bits)
if: ${{github.event.inputs.mingw_arch == 'x86-64'}}
run: |
git clone --depth 1 https://github.com/openssl/openssl.git && cd openssl
./Configure mingw64 --release --prefix="$PWD/../openssl-build" --cross-compile-prefix=x86_64-w64-mingw32- no-filenames no-docs no-tests && make && make install
- name: Setup OpenSSL (32-bits)
if: ${{github.event.inputs.mingw_arch == 'i686'}}
run: |
git clone --depth 1 https://github.com/openssl/openssl.git && cd openssl
./Configure mingw --release --prefix="$PWD/../openssl-build" --cross-compile-prefix=i686-w64-mingw32- no-filenames no-docs no-tests && make && make install
- name: Build
run: export OPENSSL_DIR="$PWD/../openssl-build" && cargo build --release --target ${{github.event.inputs.pkg_arch}}
working-directory: ./cli
- name: Rename
run: |
cd './cli/target/${{github.event.inputs.pkg_arch}}/release'
mv code.exe codius-tunnel.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: codius-${{github.event.inputs.pkg_arch}}-${{github.event.inputs.pkg_version}}
path: './cli/target/${{github.event.inputs.pkg_arch}}/release/codius-tunnel.exe'
overwrite: true
compression-level: 9
if-no-files-found: error
build-linux:
if: ${{ contains(github.event.inputs.pkg_arch, '-linux-') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{github.event.inputs.pkg_arch}}
- name: Build
run: cargo build --release --target ${{github.event.inputs.pkg_arch}}
working-directory: ./cli
- name: Rename
run: |
cd './cli/target/${{github.event.inputs.pkg_arch}}/release'
mv code codius-tunnel
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: codius-${{github.event.inputs.pkg_arch}}-${{github.event.inputs.pkg_version}}
path: './cli/target/${{github.event.inputs.pkg_arch}}/release/codius-tunnel'
overwrite: true
compression-level: 9
if-no-files-found: error