Skip to content

Commit 95e5330

Browse files
committed
docs: update config example
1 parent 2890234 commit 95e5330

File tree

3 files changed

+73
-67
lines changed

3 files changed

+73
-67
lines changed

.github/workflows/build.yml

+40-30
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,28 @@ jobs:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
os:
12-
- ubuntu-latest
13-
- macOS-latest
14-
- windows-latest
11+
target: [x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, x86_64-apple-darwin, armv7-unknown-linux-gnueabihf]
12+
include:
13+
- target: x86_64-unknown-linux-gnu
14+
os: ubuntu-latest
15+
artifact_name: cryptography-learning-backend
16+
release_name: cryptography-learning-backend-linux-ubuntu-amd64
17+
use_cross: false
18+
- target: x86_64-pc-windows-gnu
19+
os: windows-latest
20+
artifact_name: cryptography-learning-backend.exe
21+
release_name: cryptography-learning-backend-windows-amd64.exe
22+
use_cross: false
23+
- target: x86_64-apple-darwin
24+
os: macos-latest
25+
artifact_name: cryptography-learning-backend
26+
release_name: cryptography-learning-backend-macos-amd64
27+
use_cross: false
28+
- target: armv7-unknown-linux-gnueabihf
29+
os: ubuntu-latest
30+
artifact_name: cryptography-learning-backend
31+
release_name: cryptography-learning-backend-linux-armv7-gnueabihf
32+
use_cross: true
1533

1634
steps:
1735
- uses: actions/checkout@v2
@@ -23,42 +41,34 @@ jobs:
2341
- uses: Swatinem/rust-cache@v2
2442
- uses: actions-rs/cargo@v1
2543
with:
26-
use-cross: true
44+
use-cross: ${{ matrix.use_cross }}
2745
command: test
2846
- uses: actions-rs/cargo@v1
2947
with:
30-
use-cross: true
31-
command: build
32-
args: --release
33-
34-
cross_compile:
35-
name: Cross Compile
36-
runs-on: ubuntu-latest
37-
strategy:
38-
matrix:
39-
target:
40-
- armv7-unknown-linux-gnueabihf
41-
steps:
42-
- uses: actions/checkout@v2
43-
- uses: actions-rs/toolchain@v1
44-
with:
45-
toolchain: stable
46-
target: ${{ matrix.target }}
47-
override: true
48-
- uses: actions-rs/cargo@v1
49-
with:
50-
use-cross: true
48+
use-cross: ${{ matrix.use_cross }}
5149
command: build
5250
args: --release --target=${{ matrix.target }}
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: ${{ matrix.release_name }}
55+
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
5356

5457
static-compile-publish:
5558
name: Static Build
5659
runs-on: ubuntu-latest
5760
env:
58-
CARGO_TERM_COLOR: always
59-
BUILD_TARGET: x86_64-unknown-linux-musl
60-
BINARY_NAME: cryptography-learning-backend-x86_64-linux-unknown-musl
61+
target: x86_64-unknown-linux-musl
62+
release_name: cryptography-learning-backend-x86_64-linux-unknown-musl
63+
artifact_name: cryptography-learning-backend
6164
steps:
6265
- uses: actions/checkout@v2
6366
- name: Static build
64-
uses: zhxiaogg/cargo-static-build@master
67+
uses: zhxiaogg/cargo-static-build@master
68+
with:
69+
cmd: cargo build --release
70+
- name: Upload artifact
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: ${{ env.release_name }}
74+
path: target/${{ env.target }}/release/${{ env.artifact_name }}

.github/workflows/release.yml

+22-36
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,28 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, windows-latest, macos-latest]
16+
target: [x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, x86_64-apple-darwin, armv7-unknown-linux-gnueabihf]
1717
include:
18-
- os: ubuntu-latest
18+
- target: x86_64-unknown-linux-gnu
19+
os: ubuntu-latest
1920
artifact_name: cryptography-learning-backend
2021
release_name: cryptography-learning-backend-linux-ubuntu-amd64
21-
- os: windows-latest
22+
use_cross: false
23+
- target: x86_64-pc-windows-gnu
24+
os: windows-latest
2225
artifact_name: cryptography-learning-backend.exe
2326
release_name: cryptography-learning-backend-windows-amd64.exe
24-
- os: macos-latest
27+
use_cross: false
28+
- target: x86_64-apple-darwin
29+
os: macos-latest
2530
artifact_name: cryptography-learning-backend
2631
release_name: cryptography-learning-backend-macos-amd64
32+
use_cross: false
33+
- target: armv7-unknown-linux-gnueabihf
34+
os: ubuntu-latest
35+
artifact_name: cryptography-learning-backend
36+
release_name: cryptography-learning-backend-linux-armv7-gnueabihf
37+
use_cross: true
2738

2839
steps:
2940
- uses: actions/checkout@v2
@@ -32,49 +43,22 @@ jobs:
3243
toolchain: stable
3344
target: ${{ matrix.target }}
3445
override: true
35-
with:
36-
toolchain: stable
37-
target: ${{ matrix.target }}
38-
override: true
3946
- uses: Swatinem/rust-cache@v2
4047
- uses: actions-rs/cargo@v1
4148
with:
42-
use-cross: true
43-
command: build
44-
args: --release
45-
- name: Upload binaries to release
46-
uses: svenstaro/upload-release-action@v1-release
47-
with:
48-
repo_token: ${{ secrets.GITHUB_TOKEN }}
49-
file: target/release/${{ matrix.artifact_name }}
50-
asset_name: ${{ matrix.release_name }}
51-
tag: ${{ github.ref }}
52-
53-
cross-compile-publish:
54-
name: Cross Compile Publish
55-
runs-on: ubuntu-latest
56-
strategy:
57-
matrix:
58-
target:
59-
- armv7-unknown-linux-gnueabihf
60-
steps:
61-
- uses: actions/checkout@v2
62-
- uses: actions-rs/toolchain@v1
63-
with:
64-
toolchain: stable
65-
target: ${{ matrix.target }}
66-
override: true
49+
use-cross: ${{ matrix.use_cross }}
50+
command: test
6751
- uses: actions-rs/cargo@v1
6852
with:
69-
use-cross: true
53+
use-cross: ${{ matrix.use_cross }}
7054
command: build
7155
args: --release --target=${{ matrix.target }}
7256
- name: Upload binaries to release
7357
uses: svenstaro/upload-release-action@v1-release
7458
with:
7559
repo_token: ${{ secrets.GITHUB_TOKEN }}
76-
file: target/${{ matrix.target }}/release/cryptography-learning-backend
77-
asset_name: cryptography-learning-backend-${{ matrix.target }}
60+
file: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
61+
asset_name: ${{ matrix.release_name }}
7862
tag: ${{ github.ref }}
7963

8064
static-compile-publish:
@@ -88,6 +72,8 @@ jobs:
8872
- uses: actions/checkout@v2
8973
- name: Static build
9074
uses: zhxiaogg/cargo-static-build@master
75+
with:
76+
cmd: cargo build --release
9177
- uses: svenstaro/upload-release-action@v1-release
9278
with:
9379
repo_token: ${{ secrets.GITHUB_TOKEN }}

example.ron

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Configuration(
2323
resource: "practice/classical/affine/zh.md"
2424
)
2525
],
26-
endpoints: [
26+
ws_endpoints: [
2727
(
2828
host: "localhost",
2929
port: 10020
@@ -32,6 +32,16 @@ Configuration(
3232
host: "192.168.16.128",
3333
port: 10020
3434
),
35+
],
36+
tcp_endpoints: [
37+
(
38+
host: "localhost",
39+
port: 10000
40+
),
41+
(
42+
host: "192.168.16.128",
43+
port: 10000
44+
),
3545
]
3646
)
3747
]

0 commit comments

Comments
 (0)