Add .forgejo/workflows/golang.yml
This commit is contained in:
parent
c356e23be3
commit
d5f7821f22
1 changed files with 39 additions and 0 deletions
39
.forgejo/workflows/golang.yml
Normal file
39
.forgejo/workflows/golang.yml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
name: Build Go Binary
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: golang
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Detect new Version
|
||||||
|
uses: https://github.com/paulhatch/semantic-version@v5.0.2
|
||||||
|
id: version
|
||||||
|
with:
|
||||||
|
tag_prefix: ""
|
||||||
|
major_pattern: "(MAJOR)"
|
||||||
|
minor_pattern: "(MINOR)"
|
||||||
|
change_path: .
|
||||||
|
version_format: "${major}.${minor}.${patch}"
|
||||||
|
|
||||||
|
- name: Build Binary
|
||||||
|
run: |
|
||||||
|
go build -ldflags="-s -w" -o haproxy-generator main.go
|
||||||
|
|
||||||
|
- name: Create new Release with semantic-version tag
|
||||||
|
uses: https://github.com/softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
allowUpdates: true
|
||||||
|
name: HaProxy K8S Backend Generator ${{ steps.version.outputs.version }}
|
||||||
|
tag_name: ${{ steps.version.outputs.version }}
|
||||||
|
files: haproxy-generator
|
Loading…
Add table
Reference in a new issue