Skip to content

Commit 8a1687c

Browse files
committed
update workflow
1 parent 5b29f30 commit 8a1687c

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

.github/workflows/go.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,59 @@ name: Release AutoIP
33
on:
44
push:
55
tags:
6-
- 'v*' # Detecta tags como v0.3.0, v1.0.0, etc.
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: "Release tag (por ejemplo: v0.3.0)"
11+
required: true
712

813
jobs:
9-
release:
10-
name: Build and Release
14+
build:
15+
name: Build binaries
1116
runs-on: ubuntu-latest
12-
17+
outputs:
18+
dist-path: ${{ steps.build.outputs.dist-path }}
1319
steps:
1420
- name: Checkout code
1521
uses: actions/checkout@v4
1622

1723
- name: Set up Go
1824
uses: actions/setup-go@v5
1925
with:
20-
go-version: '1.24'
26+
go-version: "1.24"
2127

2228
- name: Install Make
23-
run: sudo apt-get install -y make
29+
run: sudo apt-get update && sudo apt-get install -y make
2430

25-
- name: Build binaries
26-
run: make build
31+
- name: Build
32+
run: |
33+
make clean
34+
make build
35+
id: build
2736

28-
- name: Archive binaries
37+
- name: Archive dist/
2938
run: |
3039
cd dist
3140
tar -czvf autoip-linux-amd64.tar.gz autoip-amd64
32-
tar -czvf autoip-linux-386.tar.gz autoip-386
41+
tar -czvf autoip-linux-386.tar.gz autoip-386
42+
id: archive
43+
44+
release:
45+
name: Create GitHub Release
46+
needs: build
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Create or update Release
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
53+
generate_release_notes: true
3354

34-
- name: Upload to GitHub Release
55+
- name: Upload release assets
3556
uses: softprops/action-gh-release@v2
3657
with:
58+
tag_name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
3759
files: |
3860
dist/autoip-linux-amd64.tar.gz
3961
dist/autoip-linux-386.tar.gz
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)