67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
pull_request:
|
|
branches: [ "master" ]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
|
|
- name: Build wazuh-notify-go
|
|
run: |
|
|
cd wazuh-notify-go
|
|
go build -o wazuh-notifier-go .
|
|
|
|
- name: Upload wazuh-notify-go artifact
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: wazuh-notifier-go-binary
|
|
path: wazuh-notify-go/wazuh-notifier-go
|
|
|
|
- name: Build wazuh-notify-go-v2
|
|
run: |
|
|
cd wazuh-notify-go-v2
|
|
go build -o wazuh-notifier-go-v2 .
|
|
|
|
- name: Upload wazuh-notify-go-v2 artifact
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: wazuh-notifier-go-v2-binary
|
|
path: wazuh-notify-go-v2/wazuh-notifier-go-v2
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
steps:
|
|
- name: Download all build artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Release wazuh-notify-go artifact (Gitea Upload)
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: wazuh-notifier-go-binary
|
|
path: artifacts/wazuh-notifier-go-binary-internal/wazuh-notifier-go
|
|
|
|
- name: Release wazuh-notify-go-v2 artifact (Gitea Upload)
|
|
uses: christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: wazuh-notifier-go-v2-binary
|
|
path: artifacts/wazuh-notifier-go-v2-binary-internal/wazuh-notifier-go-v2
|