This commit is contained in:
alex 2026-07-13 11:32:34 +08:00
parent 2e823188ba
commit 4ed90bb103
5 changed files with 52 additions and 4 deletions

View File

@ -0,0 +1,45 @@
name: sdlan release push
run-name: ${{ gitea.actor }} is building release 🚀
on:
push:
tags:
- '*'
defaults:
run:
shell: bash --login -eo pipefail {0}
jobs:
build:
runs-on: self-hosted
steps:
- name: Add Path
run: |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
echo "$HOME/tools/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
- name: TAG推送自动编译
id: compile
shell: bash
working-directory: /usr/local/gitea-workflow/workspace/sdlan-lib-rs
run: |
flock -n build.lock -c '
git pull
rm -rf /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/x86_64-unknown-linux-musl/debian/*.deb || true
rm -rf /usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/aarch64-unknown-linux-musl/debian/*.deb || true
cargo deb --target x86_64-unknown-linux-musl --deb-revision="2-static"
cargo deb --target aarch64-unknown-linux-musl --deb-revision="2-static"
echo "built=true" >> $GITHUB_OUTPUT
' || {
echo "其他编译正在进行中,跳过本次执行"
echo "built=false" >> $GITHUB_OUTPUT
exit 0
}
- name: Upload Release Assets
if: steps.compile.outputs.built == 'true'
#uses: softprops/action-gh-release@v3
uses: workflow-actions/action-gh-release@v3
with:
files: |
/usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/x86_64-unknown-linux-musl/debian/*.deb
/usr/local/gitea-workflow/workspace/sdlan-lib-rs/target/aarch64-unknown-linux-musl/debian/*.deb

3
.gitignore vendored
View File

@ -15,4 +15,5 @@ sdlan.exe
/ca /ca
.access_token .access_token
.host .host
.config .config
build.lock

2
Cargo.lock generated
View File

@ -2343,7 +2343,7 @@ dependencies = [
[[package]] [[package]]
name = "punchnet" name = "punchnet"
version = "1.2.6" version = "1.2.7"
dependencies = [ dependencies = [
"ahash", "ahash",
"arc-swap", "arc-swap",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "punchnet" name = "punchnet"
version = "1.2.6" version = "1.2.7"
edition = "2021" edition = "2021"
license = "MIT" license = "MIT"
description = "punchnet client" description = "punchnet client"

View File

@ -1,3 +1,6 @@
SHELL := /bin/bash
.SHELLFLAGS := --login -c
self: libtun-so self: libtun-so
RUSTFLAGS="-L ." cargo build --release RUSTFLAGS="-L ." cargo build --release
@ -7,7 +10,6 @@ linux: libtun-so
aarch64: libtun-so-aarch64 aarch64: libtun-so-aarch64
RUSTFLAGS="-L ." cargo build --release --target aarch64-unknown-linux-gnu RUSTFLAGS="-L ." cargo build --release --target aarch64-unknown-linux-gnu
linux-tun: libtun-so linux-tun: libtun-so
RUSTFLAGS="-L ." cargo build --features "tun" --release RUSTFLAGS="-L ." cargo build --features "tun" --release