Update nat service to use latest version of dnat executable #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: auto_release | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
all: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set outputs | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short=8 HEAD)" >> $GITHUB_OUTPUT | |
- name: build | |
run: | | |
cargo build --release | |
cp target/release/dnat target/release/dnat_gnu; | |
- name: build_musl | |
id: build_musl | |
uses: arloor/rust_musl_action@v2 | |
- name: mv_musl_bin | |
run: | | |
# 如果target/release/不存在,则创建该文件夹 | |
if [ ! -d "target/release/" ]; then | |
mkdir -p target/release/ | |
fi | |
cp ${{ steps.build_musl.outputs.release_dir }}dnat target/release/dnat; | |
- name: gihub_release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if $(gh release delete v1.0.0 -y --cleanup-tag); | |
then echo "delete old release"; | |
else echo "no old release"; | |
fi | |
git config --local user.email "[email protected]" | |
git config --local user.name "arloor" | |
# git tag -f v1.0.0 -m 'latest' | |
# git push --force origin v1.0.0 | |
gh release create v1.0.0 target/release/dnat target/release/dnat_gnu -n "latest" --latest -t latest --target master |