Skip to content

Commit 8cbcaeb

Browse files
authored
Merge pull request #4 from geekloper/add-github-action-push-release
👷 Add release action
2 parents df1bd3a + f614d50 commit 8cbcaeb

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Create Manual Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag version'
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'
27+
28+
- name: Build binary
29+
run: |
30+
mkdir -p build
31+
GOOS=linux GOARCH=amd64 go build -o build/bot-ip-whitelister-linux-amd64
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: build/bot-ip-whitelister-linux-amd64
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)