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 8, 2024
1 parent 649d7be commit 9c61c85
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

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

jobs:
release:
runs-on: ubuntu-latest
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 && sha256sum *)"'
```
' > .build/body.md
- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifactErrorsFailBuild: true
replacesArtifacts: true
artifacts: .build/*
tag: release-main-latest
bodyFile: .build/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 9c61c85

Please sign in to comment.