-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (70 loc) · 2.25 KB
/
Copy pathrelease-engine.yml
File metadata and controls
83 lines (70 loc) · 2.25 KB
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
name: Release Engine
on:
push:
tags:
- 'engine/v*'
permissions:
contents: write
packages: write
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Set goreleaser tag
run: |
# Strip "engine/" prefix so goreleaser sees a clean semver tag
TAG="${GITHUB_REF#refs/tags/engine/}"
echo "GORELEASER_CURRENT_TAG=${TAG}" >> "$GITHUB_ENV"
# Create a local tag alias so goreleaser can validate the tag against
# the current commit. Goreleaser reads tags but never pushes them, so
# this won't pollute the remote. The namespaced tag (engine/vX.Y.Z) is
# what triggered this workflow; goreleaser needs the plain vX.Y.Z form.
git tag -f "${TAG}"
- name: Generate NOTICE
run: |
go install github.com/google/go-licenses/v2@v2.0.1
go-licenses report ./... > NOTICE
working-directory: packages/engine
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
workdir: packages/engine
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
trivy:
name: Trivy Scan
runs-on: ubuntu-latest
needs: release
steps:
- name: Extract version
id: vars
run: |
TAG="${GITHUB_REF#refs/tags/engine/v}"
echo "version=${TAG}" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@v0.36.0
with:
image-ref: "ghcr.io/dvflw/mantle:${{ steps.vars.outputs.version }}"
format: table
exit-code: '1'
severity: CRITICAL,HIGH
ignore-unfixed: true
trivyignores: packages/engine/.trivyignore