diff --git a/.gitea/workflows/release-deb.yaml b/.gitea/workflows/release-deb.yaml new file mode 100644 index 0000000..b070f48 --- /dev/null +++ b/.gitea/workflows/release-deb.yaml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 456bf32..a25bc62 100755 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ sdlan.exe /ca .access_token .host -.config \ No newline at end of file +.config +build.lock \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 726afbf..6e2dd34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2343,7 +2343,7 @@ dependencies = [ [[package]] name = "punchnet" -version = "1.2.6" +version = "1.2.7" dependencies = [ "ahash", "arc-swap", diff --git a/Cargo.toml b/Cargo.toml index c555f35..45fa7a0 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "punchnet" -version = "1.2.6" +version = "1.2.7" edition = "2021" license = "MIT" description = "punchnet client" diff --git a/Makefile b/Makefile index 9c6e454..9635acc 100755 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +SHELL := /bin/bash +.SHELLFLAGS := --login -c + self: libtun-so RUSTFLAGS="-L ." cargo build --release @@ -7,7 +10,6 @@ linux: libtun-so aarch64: libtun-so-aarch64 RUSTFLAGS="-L ." cargo build --release --target aarch64-unknown-linux-gnu - linux-tun: libtun-so RUSTFLAGS="-L ." cargo build --features "tun" --release