Skip to content

Commit 54d4f2a

Browse files
authored
Merge branch 'SUNET:main' into main
2 parents e6aa833 + 2ea8a4b commit 54d4f2a

File tree

334 files changed

+33181
-13818
lines changed

Some content is hidden

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

334 files changed

+33181
-13818
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gomod"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
13+
- package-ecosystem: "docker"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"

.github/workflows/build.yaml

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,40 @@
1-
name: build-main
1+
name: release-tag
22
on:
33
pull_request:
44
types:
55
- closed
66

7+
permissions:
8+
contents: write
9+
710
jobs:
8-
if_merged:
11+
tag:
912
if: github.event.pull_request.merged == true
1013
runs-on: ubuntu-latest
11-
outputs:
12-
release_tag: ${{ steps.set_tag.outputs.release_tag }}
1314
steps:
1415
- name: Checkout repository
1516
uses: actions/checkout@v4
16-
17-
- name: Set release tag with timestamp
18-
id: set_tag
19-
run: |
20-
# Generate ISO8601-style timestamp with milliseconds
21-
# Format: YYYY_MM_DD_HHMMSSmmm (e.g., 2025_12_08_123052345)
22-
TIMESTAMP=$(date -u +'%Y_%m_%d_%H%M%S%3N')
23-
echo "release_tag=${TIMESTAMP}" >> $GITHUB_OUTPUT
24-
echo "Release tag: ${TIMESTAMP}"
25-
26-
- name: Install Go
27-
uses: actions/setup-go@v4
28-
with:
29-
go-version-file: go.mod
30-
cache-dependency-path: "**/*.sum"
31-
32-
- name: Install deb packages
33-
uses: awalsh128/cache-apt-pkgs-action@latest
3417
with:
35-
packages: protobuf-compiler
36-
version: 1.0
18+
fetch-depth: 0
3719

38-
- name: Install go packages
20+
- name: Read version
21+
id: version
3922
run: |
40-
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
41-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
42-
export PATH="$PATH:$(go env GOPATH)/bin"
43-
go install github.com/swaggo/swag/cmd/swag@latest
44-
45-
- name: Build
46-
run: make build
23+
VERSION=$(cat VERSION | tr -d '[:space:]')
24+
RELEASE_TAG="v${VERSION}"
25+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
26+
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
27+
echo "Version: ${VERSION}, Release tag: ${RELEASE_TAG}"
4728
48-
- name: Create GitHub Release
49-
uses: softprops/action-gh-release@v1
50-
with:
51-
tag_name: release_${{ steps.set_tag.outputs.release_tag }}
52-
name: Release ${{ steps.set_tag.outputs.release_tag }}
53-
body: |
54-
## Docker Images
55-
All services tagged with: `${{ steps.set_tag.outputs.release_tag }}`
56-
57-
### Services
58-
- apigw_${{ steps.set_tag.outputs.release_tag }}
59-
- verifier_${{ steps.set_tag.outputs.release_tag }}
60-
- registry_${{ steps.set_tag.outputs.release_tag }}
61-
- mockas_${{ steps.set_tag.outputs.release_tag }}
62-
- issuer_${{ steps.set_tag.outputs.release_tag }}
63-
- ui_${{ steps.set_tag.outputs.release_tag }}
64-
- verifier-proxy_${{ steps.set_tag.outputs.release_tag }}
65-
draft: false
66-
prerelease: false
67-
env:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Create git tag
30+
run: |
31+
RELEASE_TAG="${{ steps.version.outputs.release_tag }}"
32+
if git rev-parse "${RELEASE_TAG}" >/dev/null 2>&1; then
33+
echo "Tag ${RELEASE_TAG} already exists — skipping"
34+
else
35+
git config user.name "github-actions[bot]"
36+
git config user.email "github-actions[bot]@users.noreply.github.com"
37+
git tag -a "${RELEASE_TAG}" -m "Release ${RELEASE_TAG}"
38+
git push origin "${RELEASE_TAG}"
39+
echo "Created and pushed tag ${RELEASE_TAG}"
40+
fi

.github/workflows/pr-rc-build.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: pr-rc-build
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
jobs:
11+
rc-build:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
rc_tag: ${{ steps.rc_tag.outputs.rc_tag }}
15+
version: ${{ steps.rc_tag.outputs.version }}
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
20+
- name: Generate RC tag
21+
id: rc_tag
22+
run: |
23+
VERSION=$(cat VERSION | tr -d '[:space:]')
24+
SHORT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-8)
25+
PR_NUMBER=${{ github.event.pull_request.number }}
26+
RC_TAG="${VERSION}-rc.${PR_NUMBER}.${SHORT_SHA}"
27+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
28+
echo "rc_tag=${RC_TAG}" >> $GITHUB_OUTPUT
29+
echo "RC tag: ${RC_TAG}"
30+
31+
- name: Install Go
32+
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
33+
with:
34+
go-version-file: go.mod
35+
cache-dependency-path: "**/*.sum"
36+
37+
- name: Install deb packages
38+
uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.6.0
39+
with:
40+
packages: protobuf-compiler
41+
version: 1.0
42+
43+
- name: Install go packages
44+
run: |
45+
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
46+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
47+
export PATH="$PATH:$(go env GOPATH)/bin"
48+
go install github.com/swaggo/swag/cmd/swag@latest
49+
50+
- name: Build
51+
run: make build
52+
53+
- name: Comment RC tag on PR
54+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
55+
with:
56+
script: |
57+
const rcTag = '${{ steps.rc_tag.outputs.rc_tag }}';
58+
const version = '${{ steps.rc_tag.outputs.version }}';
59+
const body = `### 🏗️ Release Candidate Build
60+
61+
**RC Tag:** \`${rcTag}\`
62+
**Target Release:** \`v${version}\`
63+
**Commit:** \`${{ github.event.pull_request.head.sha }}\`
64+
65+
#### Docker Images
66+
| Service | Image |
67+
|---------|-------|
68+
| apigw | \`docker.sunet.se/iam_vc/apigw:${rcTag}\` |
69+
| verifier | \`docker.sunet.se/iam_vc/verifier:${rcTag}\` |
70+
| registry | \`docker.sunet.se/iam_vc/registry:${rcTag}\` |
71+
| mockas | \`docker.sunet.se/iam_vc/mockas:${rcTag}\` |
72+
| issuer | \`docker.sunet.se/iam_vc/issuer:${rcTag}\` |
73+
| ui | \`docker.sunet.se/iam_vc/ui:${rcTag}\` |
74+
75+
> Deploy with: \`VERSION=${rcTag} docker compose pull\``;
76+
77+
// Find and update existing RC comment or create new one
78+
const { data: comments } = await github.rest.issues.listComments({
79+
owner: context.repo.owner,
80+
repo: context.repo.repo,
81+
issue_number: context.issue.number,
82+
});
83+
const botComment = comments.find(c =>
84+
c.user.type === 'Bot' && c.body.includes('Release Candidate Build')
85+
);
86+
if (botComment) {
87+
await github.rest.issues.updateComment({
88+
owner: context.repo.owner,
89+
repo: context.repo.repo,
90+
comment_id: botComment.id,
91+
body: body,
92+
});
93+
} else {
94+
await github.rest.issues.createComment({
95+
owner: context.repo.owner,
96+
repo: context.repo.repo,
97+
issue_number: context.issue.number,
98+
body: body,
99+
});
100+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: version-bump
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
bump:
6+
description: "Version bump type"
7+
required: true
8+
type: choice
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
jobs:
19+
bump:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Bump version
28+
id: bump
29+
run: |
30+
CURRENT=$(cat VERSION | tr -d '[:space:]')
31+
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
32+
33+
case "${{ inputs.bump }}" in
34+
major)
35+
MAJOR=$((MAJOR + 1))
36+
MINOR=0
37+
PATCH=0
38+
;;
39+
minor)
40+
MINOR=$((MINOR + 1))
41+
PATCH=0
42+
;;
43+
patch)
44+
PATCH=$((PATCH + 1))
45+
;;
46+
esac
47+
48+
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
49+
echo "${NEW_VERSION}" > VERSION
50+
51+
echo "old_version=${CURRENT}" >> $GITHUB_OUTPUT
52+
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
53+
echo "Bumped ${CURRENT} -> ${NEW_VERSION}"
54+
55+
- name: Update CHANGELOG.md
56+
run: |
57+
OLD="${{ steps.bump.outputs.old_version }}"
58+
NEW="${{ steps.bump.outputs.new_version }}"
59+
DATE=$(date -u +%Y-%m-%d)
60+
61+
# Insert new version header after [Unreleased]
62+
sed -i "/^## \[Unreleased\]/a\\
63+
\\
64+
## [${NEW}] - ${DATE}" CHANGELOG.md
65+
66+
- name: Create version bump PR
67+
uses: peter-evans/create-pull-request@v6
68+
with:
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
commit-message: "chore: bump version to ${{ steps.bump.outputs.new_version }}"
71+
branch: "version-bump/${{ steps.bump.outputs.new_version }}"
72+
title: "chore: bump version ${{ steps.bump.outputs.old_version }} → ${{ steps.bump.outputs.new_version }}"
73+
body: |
74+
## Version Bump
75+
76+
| | Version |
77+
|---|---------|
78+
| **Previous** | `${{ steps.bump.outputs.old_version }}` |
79+
| **New** | `${{ steps.bump.outputs.new_version }}` |
80+
| **Bump type** | `${{ inputs.bump }}` |
81+
82+
This PR was auto-generated by the version-bump workflow.
83+
84+
After merging, all subsequent PRs will produce RC builds tagged as
85+
`${{ steps.bump.outputs.new_version }}-rc.{PR#}.{sha}`.
86+
labels: |
87+
release
88+
automated

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ docs/design/
3535
config.conformance.yaml
3636
.ngrok-url
3737
ngrok.log
38-
verifier-proxy.log
38+
verifier.log
3939
playwright-screenshots/
4040

4141
# VS Code MCP configuration (contains personal tokens)
4242
.vscode/mcp.json
4343

44+
# MDOC manual
4445
ISO_IEC_18013_5_2021_EN.pdf
4546
# Temporary debug/test files
4647
tmp/
48+
49+
# Runtime secrets – never commit real values
50+
secrets.yaml

.jenkins.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
builders:
2+
- script
3+
4+
triggers:
5+
github_push: true
6+
7+
slack:
8+
room: "dc4eu-builds"
9+
10+
pre_build_script:
11+
- "apt-get update && apt-get install -y protobuf-compiler"
12+
13+
script:
14+
- |
15+
set -e
16+
17+
# Determine version tag based on branch
18+
VERSION=$(cat VERSION | tr -d '[:space:]')
19+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
20+
SHORT_SHA=$(git rev-parse --short=8 HEAD)
21+
22+
if [ "$BRANCH" = "main" ]; then
23+
BUILD_TAG="${VERSION}"
24+
PUSH_LATEST=true
25+
else
26+
PR_NUM=$(echo "$BRANCH" | grep -oP '\d+' | head -1)
27+
if [ -n "$PR_NUM" ]; then
28+
BUILD_TAG="${VERSION}-rc.${PR_NUM}.${SHORT_SHA}"
29+
else
30+
BUILD_TAG="${VERSION}-rc.${SHORT_SHA}"
31+
fi
32+
PUSH_LATEST=false
33+
fi
34+
35+
echo "Branch: ${BRANCH}"
36+
echo "Build tag: ${BUILD_TAG}"
37+
echo "Push latest: ${PUSH_LATEST}"
38+
39+
# Build and push Docker images (vanilla, no build tags)
40+
make docker-build VERSION=${BUILD_TAG}
41+
make docker-push VERSION=${BUILD_TAG}
42+
43+
# Build and push Docker images with PKCS#11 HSM support
44+
make docker-build VERSION=${BUILD_TAG}-hsm GO_BUILD_TAGS=pkcs11
45+
make docker-push VERSION=${BUILD_TAG}-hsm
46+
47+
# Tag and push dev on RC builds
48+
if [ "$PUSH_LATEST" = "false" ]; then
49+
make docker-tag VERSION=${BUILD_TAG} NEWTAG=dev
50+
make docker-push VERSION=dev
51+
fi
52+
53+
# Tag and push latest on main branch
54+
if [ "$PUSH_LATEST" = "true" ]; then
55+
make docker-tag VERSION=${BUILD_TAG} NEWTAG=latest
56+
make docker-push VERSION=latest
57+
fi
58+
59+
clean_workspace: true

0 commit comments

Comments
 (0)