Skip to content

Commit

Permalink
Add workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
movsb committed Dec 9, 2024
1 parent 649d7be commit cec5d50
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Cross building
run: |
PREFIX=.build/tcp-over-bt
# args: OS ARCH HOST/DEVICE
_build() { GOOS=$1 GOARCH=$2 go build -o $PREFIX-$1-$2-$3; }
_build linux arm64 device &
_build darwin arm64 host &
wait
- name: Generate body
run: |
echo '**Build At**:
* `'"$(date)"'`
* `'"$(TZ=Asia/Shanghai date)"'`
**sha256sum**:
```-
'"$(cd .build && shasum -a 256 *)"'
```
' > body.md
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifactErrorsFailBuild: true
replacesArtifacts: true
artifacts: .build/*
bodyFile: body.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/tcp-over-bt
/.build/

0 comments on commit cec5d50

Please sign in to comment.