2024-09-15 00:33:02 +08:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- local-test
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-rust:
|
2024-09-23 15:41:40 +08:00
|
|
|
runs-on: joylink-local233-rust
|
2024-09-15 00:33:02 +08:00
|
|
|
steps:
|
|
|
|
- name: 检出代码
|
|
|
|
uses: https://gitea.joylink.club/actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- uses: https://gitea.joylink.club/actions/rust-cache@v2
|
2024-09-23 16:37:50 +08:00
|
|
|
- name: Install musl-tools
|
|
|
|
run: apt-get update && apt-get install -y musl-tools
|
2024-09-15 00:33:02 +08:00
|
|
|
- name: build Release
|
|
|
|
run: |
|
2024-09-23 16:37:50 +08:00
|
|
|
echo '[source.crates-io]' > ~/.cargo/config.toml
|
|
|
|
echo 'replace-with = "rsproxy-sparse"' >> ~/.cargo/config.toml
|
|
|
|
echo '[source.rsproxy]' >> ~/.cargo/config.toml
|
|
|
|
echo 'registry = "https://rsproxy.cn/crates.io-index"' >> ~/.cargo/config.toml
|
|
|
|
echo '[source.rsproxy-sparse]' >> ~/.cargo/config.toml
|
|
|
|
echo 'registry = "sparse+https://rsproxy.cn/index/"' >> ~/.cargo/config.toml
|
|
|
|
echo '[registries.rsproxy]' >> ~/.cargo/config.toml
|
|
|
|
echo 'index = "https://rsproxy.cn/crates.io-index"' >> ~/.cargo/config.toml
|
|
|
|
echo '[net]' >> ~/.cargo/config.toml
|
|
|
|
echo 'git-fetch-with-cli = true' >> ~/.cargo/config.toml
|
|
|
|
cat $HOME/.cargo/config.toml
|
2024-09-15 14:27:11 +08:00
|
|
|
. ~/.bashrc
|
2024-09-15 10:03:37 +08:00
|
|
|
echo $PATH
|
2024-09-15 00:33:02 +08:00
|
|
|
rustup target add x86_64-unknown-linux-musl
|
|
|
|
cargo build --release --target x86_64-unknown-linux-musl
|
|
|
|
- name: 设置 Docker
|
|
|
|
uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1
|
|
|
|
- name: 设置 Docker Buildx
|
|
|
|
uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3
|
|
|
|
- name: docker登录gitea.joylink.club
|
|
|
|
uses: https://gitea.joylink.club/docker/login-action@v3
|
|
|
|
with:
|
|
|
|
registry: gitea.joylink.club
|
|
|
|
username: shengxuqiang
|
|
|
|
password: ${{ secrets.SHENGXUQIANG_PASSWORD }}
|
|
|
|
- name: Docker Build and push
|
|
|
|
uses: https://gitea.joylink.club/docker/build-push-action@v5
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./Dockerfile
|
|
|
|
push: true
|
|
|
|
tags: |
|
2024-10-31 15:12:26 +08:00
|
|
|
gitea.joylink.club/joylink/rtsam:lt
|
2024-09-15 00:33:02 +08:00
|
|
|
- name: 发布到本地测试环境
|
|
|
|
uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.LOCAL_233_SSH_HOST }}
|
|
|
|
port: ${{ secrets.LOCAL_233_SSH_PORT }}
|
|
|
|
username: ${{ secrets.LOCAL_233_SSH_USER }}
|
|
|
|
password: ${{ secrets.LOCAL_233_SSH_PASSWORD }}
|
|
|
|
script: |
|
2024-10-31 15:12:26 +08:00
|
|
|
docker rm -f rtsa-simulation || echo "rtsa-simulation not exist"
|
|
|
|
docker pull gitea.joylink.club/joylink/rtsa-simulation:local-test
|
|
|
|
docker run --name rtsa-simulation --restart=always -e RUN_MODE=local_test --network jlnet --ip 10.11.11.11 -d -p 8765:8765 -v /usr/local/joylink/logs/simulation:/logs/simulation gitea.joylink.club/joylink/rtsa-simulation:local-test
|