Skip to content

Commit 8e2e476

Browse files
committed
feat: add github action yml
1 parent 462efaf commit 8e2e476

File tree

5 files changed

+42
-11
lines changed

5 files changed

+42
-11
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: set up go
13+
uses: actions/setup-go@v2
14+
with:
15+
go-version: 1.17
16+
- name: reviewdog
17+
uses: reviewdog/action-setup@v1
18+
run: reviewdog -conf=.reviewdog.yml -reporter=github-pr-check
19+
- name: build
20+
env:
21+
TRAVIS_TAG: ${github.ref_name}
22+
run: ./scripts/binary.sh darwin && ./scripts/binary.sh windows && ./scripts/binary.sh linux
23+
- name: update
24+
uses: softprops/action-gh-release@v1
25+
if: startsWith(github.ref, 'refs/tags/')
26+
with:
27+
files: |
28+
dist/docker-debug-darwin-amd64
29+
dist/docker-debug-linux-amd64
30+
dist/docker-debug-windows-amd64.exe

README-zh-Hans.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ brew install docker-debug
2626
**下载二进制文件**
2727
``` shell
2828
# MacOS
29-
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-darwin-amd64
29+
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-darwin-amd64
3030

3131
# Linux
32-
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-linux-amd64
32+
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-linux-amd64
3333

3434
chmod +x ./docker-debug
3535
sudo mv docker-debug /usr/local/bin/
3636

3737
# Windows
38-
curl -Lo docker-debug.exe https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-windows-amd64.exe
38+
curl -Lo docker-debug.exe https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-windows-amd64.exe
3939
```
4040

4141
或者到 [release page](https://github.com/zeromake/docker-debug/releases/lastest) 下载最新可执行文件并添加到 PATH。
@@ -64,7 +64,7 @@ docker-debug 使用 `nicolaka/netshoot` 作为默认镜像来运行额外容器
6464
你可以通过命令行 `flag(--image)` 覆盖默认镜像,或者直接修改配置文件 `~/.docker-debug/config.toml` 中的 `image`
6565
``` toml
6666
# 配置文件版本号
67-
version = "0.7.3"
67+
version = "0.7.4"
6868
# 目标容器文件系统挂载点
6969
mount_dir = "/mnt/container"
7070
# 默认镜像

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ brew install docker-debug
2727
**download binary file**
2828
``` shell
2929
# MacOS
30-
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-darwin-amd64
30+
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-darwin-amd64
3131

3232
# Linux
33-
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-linux-amd64
33+
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-linux-amd64
3434

3535
chmod +x ./docker-debug
3636
sudo mv docker-debug /usr/local/bin/
3737

3838
# Windows
39-
curl -Lo docker-debug.exe https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-windows-amd64.exe
39+
curl -Lo docker-debug.exe https://github.com/zeromake/docker-debug/releases/download/v0.7.4/docker-debug-windows-amd64.exe
4040
```
4141

4242
download the latest binary from the [release page](https://github.com/zeromake/docker-debug/releases/lastest) and add it to your PATH.
@@ -64,7 +64,7 @@ mv docker-debug /usr/local/bin
6464
docker-debug uses nicolaka/netshoot as the default image to run debug container.
6565
You can override the default image with cli flag, or even better, with config file ~/.docker-debug/config.toml
6666
``` toml
67-
version = "0.7.3"
67+
version = "0.7.4"
6868
image = "nicolaka/netshoot:latest"
6969
mount_dir = "/mnt/container"
7070
timeout = 10000000000

scripts/binary.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ source ./scripts/variables.env
88
if [[ -n $OS ]]; then
99
source ./scripts/variables.${OS}.env
1010
fi
11-
echo "Building statically linked $TARGET"
11+
echo "Building statically linked $VERSION $TARGET"
1212
export CGO_ENABLED=0
1313
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}"
1414

scripts/variables.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
PLATFORM=${PLATFORM:-"TravisLinux"}
2-
VERSION=${VERSION:-$TRAVIS_TAG}
3-
VERSION=${VERSION:-"unknown-version"}
2+
V=${VERSION:-$TRAVIS_TAG}
3+
V=${VERSION:-"unknown-version"}
44
GITCOMMIT=${GITCOMMIT:-$(git rev-parse --short HEAD 2> /dev/null || true)}
55
BUILDTIME=${BUILDTIME:-$(date +'%Y-%m-%d %H:%M:%S %z')}
6+
VERSION=`echo $V | sed 's/^v//g'`
67

78
PLATFORM_LDFLAGS=
89
if test -n "${PLATFORM}"; then

0 commit comments

Comments
 (0)