Skip to content

Commit dcbf479

Browse files
authored
release 0.0.4 (#9)
* fix cicd bug * release 0.0.4 version
1 parent ed423ef commit dcbf479

File tree

15 files changed

+84
-19
lines changed

15 files changed

+84
-19
lines changed

.github/workflows/client_build.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
- uses: actions/checkout@v3
1515
with:
1616
submodules: true
17-
-
18-
name: Set up QEMU
19-
uses: docker/setup-qemu-action@v2
20-
with:
21-
platforms: arm64
17+
#-
18+
# name: Set up QEMU
19+
# uses: docker/setup-qemu-action@v2
20+
# with:
21+
# platforms: arm64
2222

2323
-
2424
name: Set up Docker Buildx
@@ -35,7 +35,7 @@ jobs:
3535
uses: docker/build-push-action@v2
3636
with:
3737
context: .
38-
platforms: linux/amd64,linux/arm64
38+
#platforms: linux/amd64,linux/arm64
3939
push: true
4040
file: command/docker/client/client.Dockerfile
4141
cache-from: type=gha

.github/workflows/client_build_arm64.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: fornet arm64 client build
22
# run at self-hosted mac min M2
3+
# But it does not success for SSL timeout. we may try other methods to do this
34
on:
45
workflow_dispatch:
56
inputs:
@@ -35,7 +36,7 @@ jobs:
3536
file: command/docker/client/client.Dockerfile
3637
cache-from: type=gha
3738
cache-to: type=gha,mode=max
38-
tags: ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}}, ${{ env.REGISTRY }}/fornetcode/fornet:latest
39+
tags: ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}}
3940
- name: copy binary from docker to release directory
4041
run: |
4142
mkdir -p release
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: fornet arm64 client build
2+
# run at self-hosted mac min M2
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
required: true
8+
description: "version to release"
9+
env:
10+
REGISTRY: ghcr.io
11+
jobs:
12+
mac_arm64:
13+
strategy:
14+
max-parallel: 1
15+
fail-fast: true
16+
matrix:
17+
settings:
18+
- host: self-hosted
19+
target: aarch64-apple-darwin
20+
build: make release-mac-aarch64
21+
22+
runs-on: ${{ matrix.settings.host }}
23+
steps:
24+
- uses: actions/checkout@v3
25+
with:
26+
submodules: true
27+
- name: Install Rust
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: stable
31+
target: ${{ matrix.settings.target }}
32+
profile: minimal
33+
- name: Set up cargo cache
34+
uses: actions/cache@v3
35+
continue-on-error: false
36+
with:
37+
path: |
38+
~/.cargo/bin/
39+
~/.cargo/registry/index/
40+
~/.cargo/registry/cache/
41+
~/.cargo/git/db/
42+
client/target/
43+
key: ${{ matrix.settings.host }}-${{ matrix.settings.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
44+
restore-keys: ${{ matrix.settings.host }}-cargo-${{ matrix.settings.target }}
45+
# - name: Setup tmate session
46+
# uses: mxschmitt/action-tmate@v3
47+
- name: Build
48+
run: ${{ matrix.settings.build }}
49+
50+
- name: Upload artifact
51+
uses: actions/upload-artifact@v2
52+
with:
53+
path: release/*
54+
if-no-files-found: error

.github/workflows/server_build.yml

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v3
16+
with:
17+
submodules: true
18+
1619
- uses: coursier/cache-action@v6
1720
- uses: coursier/setup-action@v1
1821
with:
@@ -44,3 +47,8 @@ jobs:
4447
cache-from: type=gha
4548
cache-to: type=gha,mode=max
4649
tags: ${{ env.REGISTRY }}/fornetcode/fornet-backend:${{github.event.inputs.version}}
50+
- name: Upload jar to artifact
51+
uses: actions/upload-artifact@v2
52+
with:
53+
path: release/*
54+
if-no-files-found: error

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ release-mac-x86_64:
1616
otool -L client/target/x86_64-apple-darwin/release/fornet-cli
1717
tar -C client/target/x86_64-apple-darwin/release/ -czvf release/fornet-mac-x86_64.tar.gz ./fornet ./fornet-cli
1818

19+
# brew install cmake wget
1920
release-mac-aarch64:
2021
mkdir protoc && cd protoc && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.9/protoc-21.9-osx-aarch_64.zip && unzip protoc-21.9-osx-aarch_64.zip && sudo cp bin/protoc /usr/local/bin
2122
cp -r protoc/include/* protobuf/
@@ -51,4 +52,6 @@ release-backend:
5152
cd admin-web && npm ci && npm run build:prod && cd ../
5253
cp -r admin-web/build/ command/docker/backend/web
5354
cd backend && sbt universal:packageBin && cd ../
55+
mkdir release
56+
cp backend/target/universal/app-*.zip release/
5457
cp backend/target/universal/app-*.zip command/docker/backend/app.zip && cd command/docker/backend && unzip app.zip && rm app.zip && mv app-* app

admin-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "admin-web",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"private": true,
55
"dependencies": {
66
"@reduxjs/toolkit": "^1.8.6",

backend/build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lazy val webSugar = RootProject(file("../third/web-sugar"))
2121
lazy val app = project
2222
.in(file("."))
2323
.settings(
24-
version := "0.0.3",
24+
version := "0.0.4",
2525
scalaVersion := scala3Version,
2626
libraryDependencies ++=
2727
Seq(

client/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/bin/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fornet"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition = "2021"
55

66
[[bin]]

client/lib/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fornet-lib"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition = "2021"
55

66
# For test

command/docker-compose/simple/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: "3"
33
services:
44

55
mqtt:
6-
image: rmqtt/rmqtt:0.2.11
6+
image: rmqtt/rmqtt:latest
77
container_name: mqtt
88
ports:
99
- 1883:1883

command/docker/client/client.Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG BASE_IMAGE=rust:1.65
99
#ARG RUNTIME_IMAGE=alpine
1010
ARG RUNTIME_IMAGE=rust:1.65
1111

12-
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS builder
12+
FROM ${BASE_IMAGE} AS builder
1313

1414
RUN apt update && apt install -y cmake bash
1515

@@ -20,19 +20,18 @@ RUN apt update && apt install -y cmake bash
2020
ADD protobuf /source/protobuf
2121
ADD third /source/third
2222
ADD client /source/client
23-
ADD win-tun-driver /source/win-tun-driver
2423
ADD command/docker/client/script.sh /script.sh
2524
RUN chmod +x /script.sh && /script.sh
2625
#RUN ls -al && cd protobuf && ls -al && cd ../
2726

2827
RUN --mount=type=cache,target=/usr/local/cargo/registry \
2928
cd /source/client && cargo build --release
3029

31-
FROM --platform=$BUILDPLATFORM ${RUNTIME_IMAGE}
30+
FROM ${RUNTIME_IMAGE}
3231

3332
ENV FORNET_CONFIG=/config
3433

35-
RUN mkdir /config && apt-get update && apt install -y iproute2
34+
RUN mkdir /config && apt update && apt install -y iproute2
3635

3736
COPY --from=builder /source/client/target/release/fornet /usr/bin
3837
COPY --from=builder /source/client/target/release/fornet-cli /usr/bin

command/docker/client/docker_build.sh

100644100755
File mode changed.

command/docker/client/script.sh

100644100755
File mode changed.

command/docker/mqtt/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# 1883(mqtt) 6060(http) 5363(grpc)
44
# docker rm -f mqtt
5-
docker run -d --name mqtt --network=host -v $(pwd)/log:/var/log/rmqtt -v $(pwd)/config/rmqtt.toml:/app/rmqtt/rmqtt.toml -v $(pwd)/config/plugin:/app/rmqtt/plugin rmqtt/rmqtt:0.2.11
5+
docker run -d --name mqtt --network=host -v $(pwd)/log:/var/log/rmqtt -v $(pwd)/config/rmqtt.toml:/app/rmqtt/rmqtt.toml -v $(pwd)/config/plugin:/app/rmqtt/plugin rmqtt/rmqtt:latest
66
# docker logs -f --tail 50 mqtt

0 commit comments

Comments
 (0)