Skip to content

Release Sensu Plugin #5

Release Sensu Plugin

Release Sensu Plugin #5

name: Release Sensu Plugin
on:
workflow_dispatch:
push:
tags: ["v*"]
jobs:
release-plugin:
permissions:
id-token: write
packages: write
contents: write
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.21.5'
check-latest: true
- name: Install Tools
working-directory: collector
run: make install-tools
- name: Build collector
working-directory: collector
run: make build-linux
- name: Create Archive
working-directory: collector
run: |
rm -rf /tmp/monitoring-plugin
mkdir -p /tmp/monitoring-plugin
cp -R ../sensu-plugin/allow_list /tmp/monitoring-plugin
cp -R ../sensu-plugin/bin /tmp/monitoring-plugin
cp ./otelcol-servicenow/otelcol-servicenow /tmp/monitoring-plugin/bin/otelcol-servicenow
cd /tmp/monitoring-plugin
tar -C . -zcvf monitoring-plugin-otel-linux-x86_64-${{ github.ref_name }}.tar.gz *
- name: Upload Plugin Artifact
uses: actions/upload-artifact@v4
with:
name: monitoring-plugin-otel-linux-x86_64-${{ github.ref_name }}.tar.gz
path: /tmp/monitoring-plugin/monitoring-plugin-otel-linux-x86_64-${{ github.ref_name }}.tar.gz
# Short lived because this is meant as an action for developers
retention-days: 1
- name: Add Plugin to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
monitoring-plugin-otel-linux-x86_64-${{ github.ref_name }}.tar.gz