Skip to content

Commit

Permalink
Merge pull request #1 from Issif/workflow
Browse files Browse the repository at this point in the history
add workflow
  • Loading branch information
DanMolz authored May 28, 2023
2 parents 7893442 + 0010dc9 commit f781b72
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 1 deletion.
96 changes: 96 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Release Plugins

on:
push:
tags:
- '*'

env:
OCI_REGISTRY: ghcr.io
PLUGIN_NAME: dnscollector

permissions:
contents: write
packages: write

jobs:
publish-oci-artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout Falcoctl Repo
uses: actions/checkout@v3
with:
repository: falcosecurity/falcoctl
ref: main
path: tools/falcoctl
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: '^1.20'
cache-dependency-path: tools/falcoctl/go.sum
- name: Build falcoctl
run: make
working-directory: tools/falcoctl
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
- name: Build the plugin
run: make build
working-directory: plugin
- id: StringRepoName
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.repository }}
- name: Upload OCI artifacts to GitHub packages
run: |
MAJOR=$(echo ${{ github.ref_name }} | cut -f1 -d".")
MINOR=$(echo ${{ github.ref_name }} | cut -f1,2 -d".")
DIR=$(pwd)
cd plugin/
$DIR/tools/falcoctl/falcoctl registry push \
${{ env.OCI_REGISTRY }}/${{ steps.StringRepoName.outputs.lowercase }}/plugin/${{ env.PLUGIN_NAME }}:${{ github.ref_name }} \
--config /dev/null \
--type plugin \
--version "${{ github.ref_name }}" \
--tag latest --tag $MAJOR --tag $MINOR \
--platform linux/amd64 \
--requires plugin_api_version:2.0.0 \
--depends-on ${{ env.PLUGIN_NAME }}-rules:${{ github.ref_name }} \
--name ${{ env.PLUGIN_NAME }} \
lib${{ env.PLUGIN_NAME }}.so
cd rules/
$DIR/tools/falcoctl/falcoctl registry push \
${{ env.OCI_REGISTRY }}/${{ steps.StringRepoName.outputs.lowercase }}/ruleset/${{ env.PLUGIN_NAME }}:${{ github.ref_name }} \
--config /dev/null \
--type rulesfile \
--version "${{ github.ref_name }}" \
--tag latest --tag $MAJOR --tag $MINOR \
--depends-on ${{ env.PLUGIN_NAME }}:${{ github.ref_name }} \
--name ${{ env.PLUGIN_NAME }}-rules \
${{ env.PLUGIN_NAME }}_rules.yaml
env:
FALCOCTL_REGISTRY_AUTH_BASIC: ${{ env.OCI_REGISTRY }},${{ github.repository_owner }},${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean --timeout 120m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LDFLAGS: "-buildmode=c-shared"
GOPATH: /home/runner/go
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
falco.yaml
git_clean.sh
git_clean.sh
dist
.vscode
lib*
12 changes: 12 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
builds:
- env:
- GODEBUG=cgocheck=0
main: ./plugin
binary: libdocker.so
goos:
- linux
goarch:
- amd64
flags: -buildmode=c-shared
checksum:
name_template: "checksums.txt"
26 changes: 26 additions & 0 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: dnscollector
type: plugin
registry: ghcr.io
repository: sysdigdan/dnscollector-plugin/plugin/dnscollector
description: Reads events from dnscollector Engine
home: https://github.com/SysdigDan/dnscollector-falco-plugin
keywords:
- dnscollector
license: Apache-2.0
mastertainers:
- name: Daniel Moloney
sources:
- https://github.com/SysdigDan/dnscollector-falco-plugin
- name: dnscollector-rules
type: rulesfile
registry: ghcr.io
repository: sysdigdan/dnscollector-plugin/ruleset/dnscollector
description: Rules for the dnscollector plugin
home: https://github.com/SysdigDan/dnscollector-falco-plugin/tree/master/rules
keywords:
- dnscollector
license: Apache-2.0
mastertainers:
- name: Daniel Moloney
sources:
- https://github.com/SysdigDan/dnscollector-falco-plugin/tree/master/rules/dnscollector_rules.yaml
File renamed without changes.

0 comments on commit f781b72

Please sign in to comment.