Skip to content

format and action

format and action #1

Workflow file for this run

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_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 -n "latest" --latest -t latest --target master