Skip to content

Commit 9c61c85

Browse files
committed
Add workflow files
1 parent 649d7be commit 9c61c85

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-go@v5
14+
with:
15+
go-version-file: go.mod
16+
- name: Cross building
17+
run: |
18+
PREFIX=.build/tcp-over-bt
19+
20+
# args: OS ARCH HOST/DEVICE
21+
_build() { GOOS=$1 GOARCH=$2 go build -o $PREFIX-$1-$2-$3; }
22+
23+
_build linux arm64 device &
24+
_build darwin arm64 host &
25+
26+
wait
27+
- name: Generate body
28+
run: |
29+
echo '**Build At**:
30+
31+
* `'"$(date)"'`
32+
* `'"$(TZ=Asia/Shanghai date)"'`
33+
34+
**sha256sum**:
35+
36+
```-
37+
'"$(cd .build && sha256sum *)"'
38+
```
39+
' > .build/body.md
40+
- name: Create Release
41+
uses: ncipollo/[email protected]
42+
with:
43+
allowUpdates: true
44+
artifactErrorsFailBuild: true
45+
replacesArtifacts: true
46+
artifacts: .build/*
47+
tag: release-main-latest
48+
bodyFile: .build/body.md

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/tcp-over-bt
2+
/.build/

0 commit comments

Comments
 (0)