53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
# This workflow will build a golang project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
|
|
|
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
jobs:
|
|
generate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
|
|
- name: 'Get Previous tag'
|
|
id: previoustag
|
|
uses: "WyriHaximus/github-action-get-previous-tag@v1"
|
|
with:
|
|
prefix: v
|
|
fallback: v1.0.0 # Optional fallback tag to use when no tag can be found
|
|
- name: 'Get next minor version'
|
|
id: semvers
|
|
uses: "WyriHaximus/github-action-next-semvers@v1"
|
|
with:
|
|
version: ${{ steps.previoustag.outputs.tag }}
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Build
|
|
run: |
|
|
cd wazuh-notify-go
|
|
go build -v .
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
tag_name: ${{ steps.semvers.outputs.patch }}
|
|
files: |
|
|
wazuh-notify-go/wazuh-notify
|