Skip to content

Commit b640c7b

Browse files
committed
[ci] add azure release signing smoke workflow
1 parent ec7917e commit b640c7b

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Release signing smoke (Azure OIDC + Key Vault JAR sign)
2+
3+
# Exercises the Azure federated credential AND the Key Vault JCA jarsigner
4+
# path without dispatching a full release. Triggered by tags matching
5+
# `eXist-*-oidc-smoke` — a pattern that ci-release.yml does NOT match, so
6+
# the full release pipeline never starts.
7+
#
8+
# Validates:
9+
# 1. Federated credential's matching expression accepts eXist-* tag subject
10+
# (Azure OIDC login succeeds).
11+
# 2. Key Vault Crypto User RBAC propagated to the App Registration
12+
# (jarsigner can read the cert metadata).
13+
# 3. Cert is usable for signing (no DigiCert HSM non-exportable key issue
14+
# — Azure SDK #44085 — would surface here).
15+
# 4. TSA timestamping reachable (Sectigo URL responds).
16+
#
17+
# Usage:
18+
# git tag -a eXist-99.0.0-oidc-smoke -m "release signing smoke"
19+
# git push origin eXist-99.0.0-oidc-smoke
20+
# # watch Actions → Release signing smoke (~2-3 min)
21+
# git push origin :eXist-99.0.0-oidc-smoke # cleanup
22+
#
23+
# Mirrors ci-release.yml build-windows signing commands. Runs on
24+
# ubuntu-latest because jarsigner + the Azure JCA library are platform-
25+
# independent; this catches the same cert/RBAC failures the real Windows
26+
# job would. Authenticode .exe signing (AzureSignTool) is Windows-only
27+
# and not exercised here.
28+
29+
on:
30+
push:
31+
tags:
32+
- 'eXist-*-oidc-smoke'
33+
workflow_dispatch:
34+
35+
permissions:
36+
id-token: write
37+
contents: read
38+
39+
jobs:
40+
smoke:
41+
name: OIDC login + Key Vault JAR sign
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 10
44+
steps:
45+
- uses: actions/checkout@v6
46+
47+
- uses: actions/setup-java@v5
48+
with:
49+
distribution: temurin
50+
java-version: '21'
51+
52+
- name: Azure login (OIDC)
53+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2
54+
with:
55+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
56+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
57+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
58+
59+
- name: Confirm token + tenant
60+
run: |
61+
az account show --query "{tenantId:tenantId,user:user.name}" -o table
62+
echo "OIDC login succeeded — federated credential expression matches eXist-* tag subject."
63+
64+
- name: Build throwaway JAR to sign
65+
run: |
66+
mkdir -p /tmp/smoke && cd /tmp/smoke
67+
echo "smoke canary" > canary.txt
68+
jar cf smoke.jar canary.txt
69+
ls -la smoke.jar
70+
71+
- name: Sign smoke JAR with Azure Key Vault JCA
72+
env:
73+
AZURE_KEYVAULT_URI: ${{ vars.AZURE_KEYVAULT_URI }}
74+
AZURE_KEYVAULT_CERT_NAME: ${{ vars.AZURE_KEYVAULT_CERT_NAME }}
75+
run: |
76+
# Mirrors ci-release.yml:223-247 (Sign installer JAR step)
77+
KV_JCA_JAR="$HOME/.m2/azure-keyvault-jca.jar"
78+
if [ ! -f "$KV_JCA_JAR" ]; then
79+
mvn -q dependency:get \
80+
-Dartifact=com.azure:azure-security-keyvault-jca:2.10.0:jar \
81+
-Ddest="$KV_JCA_JAR"
82+
fi
83+
ls -la "$KV_JCA_JAR"
84+
jarsigner \
85+
-keystore NONE \
86+
-storetype AzureKeyVault \
87+
-providerClass com.azure.security.keyvault.jca.KeyVaultJcaProvider \
88+
-providerArg "-J-Dazure.keyvault.uri=${AZURE_KEYVAULT_URI}" \
89+
-J-cp "$KV_JCA_JAR" \
90+
-tsa http://timestamp.sectigo.com/ \
91+
/tmp/smoke/smoke.jar "$AZURE_KEYVAULT_CERT_NAME"
92+
93+
- name: Verify smoke JAR signature
94+
run: |
95+
jarsigner -verify -strict -verbose /tmp/smoke/smoke.jar | tail -20
96+
echo "Key Vault JCA signing succeeded — Crypto User RBAC + cert + TSA all working."

0 commit comments

Comments
 (0)