forked from louketo/louketo-proxy
-
Notifications
You must be signed in to change notification settings - Fork 50
69 lines (67 loc) · 2.36 KB
/
release.yml
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
name: Release
# Only trigger this action when a new release is published
on:
release:
types: [published]
jobs:
SBOM-upload:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- name: Generate SBOM
# generation command documentation: https://github.com/microsoft/sbom-tool#sbom-generation
run: |
curl -Lo $RUNNER_TEMP/sbom-tool https://github.com/microsoft/sbom-tool/releases/download/v1.2.0/sbom-tool-linux-x64
chmod +x $RUNNER_TEMP/sbom-tool
$RUNNER_TEMP/sbom-tool generate -b . -bc . -pn $ -pv 1.0.0 -ps "Pavol Ipoth" -nsb https://github.com/gogatekeeper -V Verbose
- uses: actions/upload-artifact@v3
with:
name: sbom
path: _manifest/spdx_2.2
- name: SBOM upload
uses: advanced-security/[email protected]
with:
filePath: "_manifest/spdx_2.2/"
goreleaser:
runs-on: ubuntu-latest
steps:
# Setup the workflow to use the specific version of Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.21.6"
# Checkout the repository
- name: Checkout
uses: actions/checkout@v2
# Cleans up unreachable Git objects and convert a shallow clone to a regular one if needed
- name: Unshallow
run: git fetch --prune --unshallow
# Publish the binaries
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: "Create k3d Cluster for E2E testing"
uses: AbsaOSS/[email protected]
with:
cluster-name: "testcluster"
args: >-
-p "8081:80@loadbalancer"
- name: "Run Tests"
run: |
k3d kubeconfig merge testcluster --kubeconfig-switch-context
KUBECONFIG=~/.k3d/kubeconfig-testcluster.yaml kubectl apply -f ./e2e/k8s/manifest.yml
go test -v -race ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}