Skip to content

Commit 51009b1

Browse files
committed
prepare release
1 parent cdede56 commit 51009b1

2 files changed

Lines changed: 87 additions & 136 deletions

File tree

.github/workflows/release.yml

Lines changed: 60 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ on:
66

77
env:
88
CARGO_TERM_COLOR: always
9-
REGISTRY: frknorg
10-
API_IMAGE_NAME: fcore-api
11-
DOCKER_TAG: latest
129

1310
jobs:
11+
tests:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Install Rust
16+
uses: dtolnay/rust-toolchain@nightly
17+
- name: Install dependencies
18+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
19+
- name: Test
20+
run: cargo test --lib
21+
1422
build-node:
23+
needs: [tests]
1524
runs-on: ubuntu-22.04
1625
strategy:
1726
matrix:
@@ -21,146 +30,96 @@ jobs:
2130
- armv7-unknown-linux-gnueabihf
2231

2332
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v4
33+
- uses: actions/checkout@v4
2634

27-
- name: Install latest rust toolchain
28-
uses: actions-rs/toolchain@v1
35+
- name: Install Rust
36+
uses: dtolnay/rust-toolchain@nightly
2937
with:
30-
toolchain: nightly
31-
default: true
32-
override: true
38+
targets: ${{ matrix.target }}
3339

34-
- name: Update apt package index
35-
run: sudo apt-get update
36-
37-
- name: Install protobuf-compiler
38-
run: sudo apt-get install -y protobuf-compiler
39-
40-
- name: Install zig
41-
run: pip3 install ziglang
42-
43-
- name: Install cargo-zigbuild
44-
run: cargo install --locked cargo-zigbuild
40+
- uses: Swatinem/rust-cache@v2
41+
with:
42+
key: ${{ matrix.target }}
4543

46-
- name: Add target
47-
run: rustup target add ${{ matrix.target }}
44+
- name: Install Build Tools
45+
run: |
46+
sudo apt-get update && sudo apt-get install -y protobuf-compiler
47+
pip3 install ziglang
48+
cargo install cargo-zigbuild
4849
49-
- name: Build for ${{ matrix.target }}
50-
run: cargo zigbuild --release --target ${{ matrix.target }} --bin node --no-default-features
50+
- name: Build Node
51+
run: cargo zigbuild --release --target ${{ matrix.target }} --bin node --features xray,wireguard
5152

52-
- name: Upload artifacts
53+
- name: Upload Artifact
5354
uses: actions/upload-artifact@v4
5455
with:
55-
name: node-${{ matrix.target }}
56+
name: fcore-node-${{ matrix.target }}
5657
path: target/${{ matrix.target }}/release/node
5758

5859
build-api:
59-
runs-on: ubuntu-latest
60-
60+
needs: [tests]
61+
runs-on: ubuntu-22.04
6162
steps:
6263
- name: Checkout
6364
uses: actions/checkout@v4
64-
65-
- name: Install latest rust toolchain
66-
uses: actions-rs/toolchain@v1
67-
with:
68-
toolchain: nightly
69-
default: true
70-
override: true
71-
72-
- name: Update apt package index
73-
run: sudo apt-get update
74-
75-
- name: Install protobuf-compiler
76-
run: sudo apt-get install -y protobuf-compiler
77-
78-
- name: Build
79-
run: cargo build --release --no-default-features --bin api
80-
81-
- name: Upload artifacts
65+
- name: Install Rust
66+
uses: dtolnay/rust-toolchain@nightly
67+
- name: Test Lib
68+
run: cargo test --lib
69+
- name: Build API
70+
run: cargo build --release --bin api --no-default-features
71+
- name: Upload Artifact
8272
uses: actions/upload-artifact@v4
8373
with:
84-
name: api
74+
name: fcore-api
8575
path: target/release/api
8676

8777
build-auth:
88-
runs-on: ubuntu-latest
89-
78+
needs: [tests]
79+
runs-on: ubuntu-22.04
9080
steps:
9181
- name: Checkout
9282
uses: actions/checkout@v4
93-
94-
- name: Install latest rust toolchain
95-
uses: actions-rs/toolchain@v1
96-
with:
97-
toolchain: nightly
98-
default: true
99-
override: true
100-
101-
- name: Update apt package index
102-
run: sudo apt-get update
103-
104-
- name: Install protobuf-compiler
105-
run: sudo apt-get install -y protobuf-compiler
106-
107-
- name: Build
108-
run: cargo build --release --no-default-features --bin auth
109-
110-
- name: Upload artifacts
83+
- name: Install Rust
84+
uses: dtolnay/rust-toolchain@nightly
85+
- uses: Swatinem/rust-cache@v2
86+
- name: Build Auth
87+
run: cargo build --release --bin auth --no-default-features --features email
88+
- name: Upload Artifact
11189
uses: actions/upload-artifact@v4
11290
with:
113-
name: auth
91+
name: fcore-auth
11492
path: target/release/auth
11593

11694
release:
117-
name: Release
95+
name: Create Release
11896
needs: [build-api, build-auth, build-node]
11997
runs-on: ubuntu-latest
120-
12198
steps:
12299
- name: Checkout
123100
uses: actions/checkout@v4
124-
125-
- name: Download all node artifacts
101+
- name: Download all artifacts
126102
uses: actions/download-artifact@v4
127103
with:
128104
path: artifacts
129-
pattern: node-*
105+
pattern: fcore-*
130106
merge-multiple: false
131107

132-
- name: Download API artifact
133-
uses: actions/download-artifact@v4
134-
with:
135-
name: api
136-
path: artifacts/api
137-
138-
- name: Download Auth artifact
139-
uses: actions/download-artifact@v4
140-
with:
141-
name: auth
142-
path: artifacts/auth
143-
144108
- name: Prepare release files
145109
run: |
146-
mkdir -p release
147-
cp artifacts/node-x86_64-unknown-linux-gnu/node release/node-x86_64
148-
cp artifacts/node-aarch64-unknown-linux-gnu/node release/node-aarch64
149-
cp artifacts/node-armv7-unknown-linux-gnueabihf/node release/node-armv7
150-
cp artifacts/api/api release/api-x86_64
151-
cp artifacts/auth/auth release/auth-x86_64
152-
chmod +x release/*
153-
154-
- name: Release
110+
mkdir -p release_dist
111+
cp artifacts/fcore-node-x86_64-unknown-linux-gnu/node release_dist/node-x86_64
112+
cp artifacts/fcore-node-aarch64-unknown-linux-gnu/node release_dist/node-aarch64
113+
cp artifacts/fcore-node-armv7-unknown-linux-gnueabihf/node release_dist/node-armv7
114+
cp artifacts/fcore-api/api release_dist/api-x86_64
115+
cp artifacts/fcore-auth/auth release_dist/auth-x86_64
116+
chmod +x release_dist/*
117+
118+
- name: Upload to GitHub Release
155119
uses: softprops/action-gh-release@v1
156-
if: startsWith(github.ref, 'refs/tags/')
157120
with:
158121
files: |
159-
release/api-x86_64
160-
release/auth-x86_64
161-
release/node-x86_64
162-
release/node-aarch64
163-
release/node-armv7
122+
release_dist/*
164123
docs/*
165124
README.md
166125
config-node-example.toml

config-agent-example.toml

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,40 @@
1-
[node]
2-
env = "experimental"
3-
uuid = "ab514c21-aaaa-bbbb-91f7-32f8cb1aaaaa"
4-
hostname = "darkmachine.frkn.local"
5-
address = "192.168.1.100"
6-
label = "🏴‍☠️ Darkmachine"
7-
max_bandwidth_bps = 1000000000
8-
country = "RU"
9-
type = "common"
1+
[service]
2+
snapshot_interval = 60
3+
snapshot_path = "snapshots/snapshot-agent.bin"
4+
log_velel = "debug"
5+
updates_endpoint_zmq = "tcp://localhost:3001"
106

11-
12-
[agent]
13-
local = false
14-
snapshot_interval = 30
15-
snapshot_path = "snapshots/agent_snapshot.bin"
7+
[metrics]
8+
interval = 100
9+
publisher = "tcp://localhost:3002"
1610

1711
[xray]
1812
enabled = true
19-
xray_config_path = "/etc/xray/config.json"
13+
path = "dev/xray-config.json"
2014

21-
[wg]
15+
[h2]
2216
enabled = true
23-
port = 51820
24-
interface = "wg0"
17+
path = "dev/h2.yaml"
2518

26-
[h2]
27-
enabled = false
28-
path = "etc/frkn/h2.yaml"
19+
[wg]
20+
enabled = false
21+
path = "dev/utun7.conf"
2922

3023
[mtproto]
3124
enabled = true
32-
port = 8443
33-
secret = "dd00112233445566778899aabbccddeeff"
25+
path = "dev/teleproxy.toml"
3426

35-
[metrics]
36-
enabled = true
37-
publisher = "tcp://api-server-ip:5555"
38-
interval = 10
27+
[node]
28+
env = "experimental"
29+
uuid = "ab514c21-aaaa-bbbb-cccc-32f8cb1ada40"
30+
hostname = "darkmachine2.frkn.local"
31+
default_interface = "ens0"
32+
address = "192.168.1.100"
33+
label = "Darkmachine 🏴‍☠️ "
34+
max_bandwidth_bps = 1000000000
35+
country = "RU"
36+
type = "common"
3937

4038
[api]
41-
endpoint = "https://api.frkn.org"
42-
token = "your-super-secret-api-token"
43-
44-
[logging]
45-
level = "warn"
46-
47-
[zmq]
48-
endpoint = "tcp://api-server-ip:3000"
39+
endpoint = "http://127.0.0.1:3000"
40+
token = "supetsecrettoken"

0 commit comments

Comments
 (0)