Skip to content

Commit 7b82f05

Browse files
committed
Merge remote-tracking branch 'upstream/main' into njpm/upsream-sync
2 parents 149d606 + 61684df commit 7b82f05

File tree

640 files changed

+48413
-32725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+48413
-32725
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
- package-ecosystem: gomod
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
time: '10:00'
13+
open-pull-requests-limit: 10

.github/workflows/codeql.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,43 @@ jobs:
2222
matrix:
2323
# Override automatic language detection by changing the below list
2424
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
25-
language: ['go']
25+
language: ["go"]
2626
# Learn more...
2727
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
2828

2929
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v4
32-
with:
33-
# We must fetch at least the immediate parents so that if this is
34-
# a pull request then we can checkout the head.
35-
fetch-depth: 2
30+
- name: Checkout repository
31+
uses: actions/checkout@v5
32+
with:
33+
# We must fetch at least the immediate parents so that if this is
34+
# a pull request then we can checkout the head.
35+
fetch-depth: 2
3636

37-
# Initializes the CodeQL tools for scanning.
38-
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@v3
40-
with:
41-
languages: ${{ matrix.language }}
42-
# If you wish to specify custom queries, you can do so here or in a config file.
43-
# By default, queries listed here will override any specified in a config file.
44-
# Prefix the list here with "+" to use these queries and those in the config file.
45-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v4
40+
with:
41+
languages: ${{ matrix.language }}
42+
# If you wish to specify custom queries, you can do so here or in a config file.
43+
# By default, queries listed here will override any specified in a config file.
44+
# Prefix the list here with "+" to use these queries and those in the config file.
45+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
4646

47-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48-
# If this step fails, then you should remove it and run the build manually (see below)
49-
- name: Autobuild
50-
uses: github/codeql-action/autobuild@v3
47+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
48+
# If this step fails, then you should remove it and run the build manually (see below)
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v4
5151

52-
# ℹ️ Command-line programs to run using the OS shell.
53-
# 📚 https://git.io/JvXDl
52+
# ℹ️ Command-line programs to run using the OS shell.
53+
# 📚 https://git.io/JvXDl
5454

55-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
56-
# and modify them (or add more) to build your code if your project
57-
# uses a compiled language
55+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
56+
# and modify them (or add more) to build your code if your project
57+
# uses a compiled language
5858

59-
#- run: |
60-
# make bootstrap
61-
# make release
59+
#- run: |
60+
# make bootstrap
61+
# make release
6262

63-
- name: Perform CodeQL Analysis
64-
uses: github/codeql-action/analyze@v3
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v4
Lines changed: 213 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,234 @@
1-
name: Upload Docker images to ghcr.io
1+
#
2+
# Based on:
3+
#
4+
# Docker docs: Distribute build across multiple runners
5+
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
6+
#
7+
8+
name: Upload Docker images to GitHub Container Registry (ghcr.io)
9+
210
on:
311
release:
4-
types: [created]
12+
types:
13+
- released
14+
15+
push:
16+
branches:
17+
- master
18+
- main
19+
20+
pull_request:
21+
branches:
22+
- master
23+
- main
24+
25+
workflow_dispatch:
26+
inputs:
27+
ref:
28+
description: Git tag to push the image
29+
required: true
30+
type: string
31+
532
jobs:
6-
docker:
33+
prepare:
34+
name: Prepare
35+
runs-on: ubuntu-latest
36+
outputs:
37+
github_repository: ${{ steps.vars.outputs.github_repository }}
38+
publish_image: ${{ steps.vars.outputs.publish_image }}
39+
semver_value: ${{ steps.vars.outputs.semver_value }}
40+
steps:
41+
- id: vars
42+
name: Prepare outputs
43+
run: |
44+
function prepend() { while read line; do echo "${1}${line}"; done; }
45+
readonly NOTICE_VAR='::notice title=Setting variable::'
46+
47+
github_repository=${{ github.repository }}
48+
echo "github_repository=${github_repository,,}" | tee -a $GITHUB_OUTPUT | prepend "$NOTICE_VAR"
49+
50+
if [ "${{ github.event_name }}" = "release" ]; then
51+
echo "publish_image=true" | tee -a $GITHUB_OUTPUT | prepend "$NOTICE_VAR"
52+
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
53+
echo "publish_image=true" | tee -a $GITHUB_OUTPUT | prepend "$NOTICE_VAR"
54+
echo "semver_value=,value=${{ inputs.ref }}" | tee -a $GITHUB_OUTPUT | prepend "$NOTICE_VAR"
55+
fi
56+
57+
build:
758
name: Build image
59+
if: github.event_name == 'pull_request'
860
runs-on: ubuntu-latest
61+
needs:
62+
- prepare
963
steps:
1064
- name: Check out code
11-
uses: actions/checkout@v4
65+
uses: actions/checkout@v5
66+
with:
67+
fetch-tags: true
68+
ref: ${{ github.ref }}
69+
1270
- name: Docker meta
1371
id: meta
1472
uses: docker/metadata-action@v5
1573
with:
1674
images: ghcr.io/${{ github.repository }}
17-
# create latest tag for branch events
18-
flavor: |
19-
latest=auto
20-
tags: |
21-
type=ref,event=branch
22-
type=ref,event=pr
23-
type=semver,pattern={{version}}
24-
type=semver,pattern={{major}}.{{minor}}
25-
type=semver,pattern={{major}}.{{minor}}.{{patch}}
26-
- name: Login to ghcr.io
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Build
80+
uses: docker/build-push-action@v6
81+
with:
82+
context: .
83+
platforms: linux/amd64
84+
push: false
85+
tags: ${{ steps.meta.outputs.tags }}
86+
labels: ${{ steps.meta.outputs.labels }}
87+
annotations: ${{ steps.meta.outputs.annotations }}
88+
89+
mbuild:
90+
name: Build image
91+
needs:
92+
- prepare
93+
if: github.event_name != 'pull_request'
94+
runs-on: ubuntu-latest
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
platform:
99+
- platform: linux/amd64
100+
- platform: linux/arm64
101+
qemu: arm64
102+
- platform: linux/arm/v7
103+
qemu: arm
104+
- platform: linux/arm/v6
105+
qemu: arm
106+
steps:
107+
- name: Prepare
108+
id: prepare
109+
run: |
110+
platform=${{ matrix.platform.platform }}
111+
echo "platform_pair=${platform//\//-}" | tee -a $GITHUB_OUTPUT
112+
113+
- name: Check out code
114+
if: github.event_name == 'workflow_dispatch'
115+
uses: actions/checkout@v5
116+
with:
117+
ref: ${{ inputs.ref }}
118+
fetch-tags: true
119+
120+
- name: Check out code
121+
if: github.event_name != 'workflow_dispatch'
122+
uses: actions/checkout@v5
123+
with:
124+
fetch-tags: true
125+
ref: ${{ github.ref }}
126+
127+
- name: Docker meta
128+
id: meta
129+
uses: docker/metadata-action@v5
130+
with:
131+
images: ghcr.io/${{ github.repository }}
132+
133+
- name: Set up QEMU
134+
uses: docker/setup-qemu-action@v3
135+
if: ${{ matrix.platform.qemu }}
136+
with:
137+
platforms: ${{ matrix.platform.qemu }}
138+
cache-image: false
139+
140+
- name: Set up Docker Buildx
141+
uses: docker/setup-buildx-action@v3
142+
143+
- name: Login to GitHub Container Registry
144+
if: needs.prepare.outputs.publish_image
27145
uses: docker/login-action@v3
28146
with:
29147
registry: ghcr.io
30148
username: ${{ github.actor }}
31149
password: ${{ secrets.GITHUB_TOKEN }}
32-
- name: Build and push
33-
id: docker_build
34-
uses: docker/build-push-action@v5
150+
151+
- name: Build
152+
if: ${{ ! needs.prepare.outputs.publish_image }}
153+
uses: docker/build-push-action@v6
35154
with:
36-
# push for non-pr events
37-
push: ${{ github.event_name != 'pull_request' }}
38155
context: .
156+
platforms: ${{ matrix.platform.platform }}
157+
push: false
39158
tags: ${{ steps.meta.outputs.tags }}
40159
labels: ${{ steps.meta.outputs.labels }}
160+
annotations: ${{ steps.meta.outputs.annotations }}
161+
162+
- name: Build and push
163+
if: needs.prepare.outputs.publish_image
164+
uses: docker/build-push-action@v6
165+
id: build
166+
with:
167+
context: .
168+
platforms: ${{ matrix.platform.platform }}
169+
labels: ${{ steps.meta.outputs.labels }}
170+
annotations: ${{ steps.meta.outputs.annotations }}
171+
outputs: type=image,"name=ghcr.io/${{ needs.prepare.outputs.github_repository }}",push-by-digest=true,name-canonical=true,push=true
172+
173+
- name: Export digest
174+
if: needs.prepare.outputs.publish_image
175+
run: |
176+
mkdir -p ${{ runner.temp }}/digests
177+
digest='${{ steps.build.outputs.digest }}'
178+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
179+
180+
- name: Upload digest
181+
if: needs.prepare.outputs.publish_image
182+
uses: actions/upload-artifact@v4
183+
with:
184+
name: digests-${{ steps.prepare.outputs.platform_pair }}
185+
path: ${{ runner.temp }}/digests/*
186+
if-no-files-found: error
187+
retention-days: 1
188+
compression-level: 0
189+
190+
merge:
191+
name: Merge images
192+
runs-on: ubuntu-latest
193+
needs:
194+
- prepare
195+
- mbuild
196+
if: needs.prepare.outputs.publish_image
197+
steps:
198+
- name: Download digests
199+
uses: actions/download-artifact@v5
200+
with:
201+
path: ${{ runner.temp }}/digests
202+
pattern: digests-*
203+
merge-multiple: true
204+
205+
- name: Login to GHCR
206+
uses: docker/login-action@v3
207+
with:
208+
registry: ghcr.io
209+
username: ${{ github.actor }}
210+
password: ${{ secrets.GITHUB_TOKEN }}
211+
212+
- name: Set up Docker Buildx
213+
uses: docker/setup-buildx-action@v3
214+
215+
- name: Docker meta
216+
id: meta
217+
uses: docker/metadata-action@v5
218+
with:
219+
images: ghcr.io/${{ github.repository }}
220+
flavor: |
221+
latest=${{ github.event_name == 'workflow_dispatch' && 'false' || 'auto' }}
222+
tags: |
223+
type=semver,pattern={{version}}${{ needs.prepare.outputs.semver_value }}
224+
type=semver,pattern={{major}}.{{minor}}${{ needs.prepare.outputs.semver_value }}
225+
type=semver,pattern={{major}}.{{minor}}.{{patch}}${{ needs.prepare.outputs.semver_value }}
226+
227+
- name: Create manifest list and push
228+
working-directory: ${{ runner.temp }}/digests
229+
run: |
230+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
231+
$(printf 'ghcr.io/${{ needs.prepare.outputs.github_repository }}@sha256:%s ' *)
232+
233+
- name: Inspect image
234+
run: docker buildx imagetools inspect ghcr.io/${{ needs.prepare.outputs.github_repository }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)