Skip to content

Commit cec5d50

Browse files
committed
Add workflow files
1 parent 649d7be commit cec5d50

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/release.yaml

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

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/tcp-over-bt
2+
/.build/

0 commit comments

Comments
 (0)