-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (76 loc) · 2.63 KB
/
release.yml
File metadata and controls
91 lines (76 loc) · 2.63 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
84
85
86
87
88
89
90
91
name: Release
on:
push:
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Release Container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
with:
go-version-file: 'go.mod'
cache: true
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: ui/compliance-dashboard/package-lock.json
- name: Install Task
uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 # v2
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build UI
run: task build:ui
- name: Test
run: task test
- name: Setup Ko
uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9
- name: Log in to GitHub Container Registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag version
id: tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Set repository owner lowercase
id: repo_owner
run: echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and push container
env:
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}
VERSION: ${{ steps.tag.outputs.VERSION }}
run: |
ko build \
--bare \
--sbom=spdx \
--platform=linux/amd64,linux/arm64 \
--base-import-paths \
--tags $VERSION,latest \
./cmd/minder-mcp
- name: Install Cosign
uses: sigstore/cosign-installer@ba7bc0a3fef59531c69a25acd34668d6d3fe6f22 # v4.1.0
- name: Sign Image with Cosign
env:
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}
run: |
TAG=$(echo "${{ steps.tag.outputs.VERSION }}" | sed 's/+/_/g')
cosign sign -y $KO_DOCKER_REPO/minder-mcp:$TAG
cosign sign -y $KO_DOCKER_REPO/minder-mcp:latest