-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (78 loc) · 2.47 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Release Plugins
on:
push:
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
env:
OCI_REGISTRY: ghcr.io
PLUGIN_NAME: k8saudit-ovh
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 \
--name ${{ env.PLUGIN_NAME }} \
lib${{ env.PLUGIN_NAME }}.so
env:
FALCOCTL_REGISTRY_AUTH_BASIC: ${{ env.OCI_REGISTRY }},${{ github.repository_owner }},${{ secrets.GITHUB_TOKEN }}
release:
runs-on: ubuntu-latest[0-9]+\.[0-9]+\.[0-9]+
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: '1.19'
- 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