-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Issif/workflow
add workflow
- Loading branch information
Showing
5 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.