-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (122 loc) · 4.12 KB
/
release.yml
File metadata and controls
140 lines (122 loc) · 4.12 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: release
on:
push:
tags:
- "v*"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
id-token: write
packages: write
env:
BACKEND_IMAGE: ghcr.io/${{ github.repository_owner }}/java-profiler-backend
COLLECTOR_IMAGE: ghcr.io/${{ github.repository_owner }}/java-profiler-collector
WEB_IMAGE: ghcr.io/${{ github.repository_owner }}/java-profiler-web
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26.0"
- run: go test ./...
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
- run: mvn test
working-directory: java-helper/thread-diagnostics
- uses: actions/setup-node@v4
with:
node-version: "22"
- run: npm ci
working-directory: web
- run: npm test
working-directory: web
- run: npm run build
working-directory: web
- uses: azure/setup-helm@v4
- run: helm lint deploy/helm -f deploy/helm/values_test.yaml
- run: sh scripts/verify-assets.sh deploy/helm/values.yaml
publish:
runs-on: ubuntu-latest
needs: validate
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive release metadata
id: meta
run: |
set -eu
case "${GITHUB_REF_NAME}" in
v*) ;;
*) echo "Release tags must start with v" >&2; exit 1 ;;
esac
release_version="${GITHUB_REF_NAME#v}"
backend_image="${BACKEND_IMAGE}:${GITHUB_REF_NAME}"
collector_image="${COLLECTOR_IMAGE}:${GITHUB_REF_NAME}"
web_image="${WEB_IMAGE}:${GITHUB_REF_NAME}"
printf 'tag=%s\n' "${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}"
printf 'version=%s\n' "${release_version}" >> "${GITHUB_OUTPUT}"
printf 'backend_image=%s\n' "${backend_image}" >> "${GITHUB_OUTPUT}"
printf 'collector_image=%s\n' "${collector_image}" >> "${GITHUB_OUTPUT}"
printf 'web_image=%s\n' "${web_image}" >> "${GITHUB_OUTPUT}"
- name: Build and push backend image
uses: docker/build-push-action@v6
id: backend
with:
context: .
file: Dockerfile.backend
push: true
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
tags: ${{ steps.meta.outputs.backend_image }}
- name: Build and push collector image
uses: docker/build-push-action@v6
id: collector
with:
context: .
file: Dockerfile.collector
push: true
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
tags: ${{ steps.meta.outputs.collector_image }}
- name: Build and push web image
uses: docker/build-push-action@v6
id: web
with:
context: .
file: Dockerfile.web
push: true
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
tags: ${{ steps.meta.outputs.web_image }}
- name: Package and publish release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -eu
scripts/release-publish.sh \
--tag "${{ steps.meta.outputs.tag }}" \
--commit "${GITHUB_SHA}" \
--backend-image "${{ steps.meta.outputs.backend_image }}" \
--collector-image "${{ steps.meta.outputs.collector_image }}" \
--web-image "${{ steps.meta.outputs.web_image }}" \
--backend-digest "${{ steps.backend.outputs.digest }}" \
--collector-digest "${{ steps.collector.outputs.digest }}" \
--web-digest "${{ steps.web.outputs.digest }}" \
--chart-dir deploy/helm