Skip to content

Commit 2e35eaf

Browse files
committed
👷 Add GitHub Actions workflow for creating and publishing releases
1 parent ede72d7 commit 2e35eaf

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Create and Publish Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag version (e.g., v1.0.0)'
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
release:
16+
name: Build and Release
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.23.x'
27+
28+
- name: Build cross-platform binaries
29+
run: |
30+
make build-all
31+
ls -l zut-* # List built files for verification
32+
33+
- name: Create Git tag
34+
run: |
35+
git config user.name "${{ github.actor }}"
36+
git config user.email "${{ github.actor }}@users.noreply.github.com"
37+
git tag ${{ inputs.tag }}
38+
git push origin ${{ inputs.tag }}
39+
40+
- name: Upload Release Assets
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
name: Release ${{ inputs.tag }}
44+
tag_name: ${{ inputs.tag }}
45+
files: |
46+
zut-linux-amd64
47+
zut-darwin-amd64
48+
zut-darwin-arm64
49+
zut-windows-amd64.exe
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)