Skip to content

Commit 7c88302

Browse files
authored
Merge pull request #156 from gosuda/feature/tunnel-release
add tunnel release cd
2 parents 2d21afe + 6167006 commit 7c88302

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,49 @@ jobs:
6060
labels: ${{ steps.meta.outputs.labels }}
6161
cache-from: type=gha,mode=max
6262
cache-to: type=gha,mode=max
63+
64+
release-binaries:
65+
name: Build and Release Tunnel Binaries
66+
if: startsWith(github.ref, 'refs/tags/v')
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: write
70+
71+
steps:
72+
- name: Checkout code
73+
uses: actions/checkout@v6
74+
75+
- name: Set up Go
76+
uses: actions/setup-go@v6
77+
with:
78+
go-version-file: go.mod
79+
cache: true
80+
81+
- name: Build tunnel binaries
82+
shell: bash
83+
run: |
84+
make build-tunnel
85+
mkdir -p release
86+
cp cmd/relay-server/dist/tunnel/portal-* release/
87+
88+
- name: Generate SHA256 checksums
89+
shell: bash
90+
run: |
91+
cd release
92+
sha256sum * > checksums.txt
93+
while read -r sum file; do
94+
printf '%s %s\n' "$sum" "$file" > "${file}.sha256"
95+
done < checksums.txt
96+
97+
- name: Publish GitHub release assets
98+
env:
99+
GH_TOKEN: ${{ github.token }}
100+
shell: bash
101+
run: |
102+
if gh release view "${GITHUB_REF_NAME}" >/dev/null 2>&1; then
103+
gh release upload "${GITHUB_REF_NAME}" release/* --clobber
104+
else
105+
gh release create "${GITHUB_REF_NAME}" release/* \
106+
--generate-notes \
107+
--title "${GITHUB_REF_NAME}"
108+
fi

0 commit comments

Comments
 (0)