Skip to content

Commit 00f7fae

Browse files
Merge branch 'main' into eee-UID2-5757-clear-default-emails-in-sample-sites
2 parents d2a9e08 + cad8a10 commit 00f7fae

27 files changed

+11221
-24012
lines changed

.github/actions/cdn_deployment_aws/action.yaml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: CDN Deployment for AWS
22
description: Deploys to AWS CDN and optionally invalidates the path in CloudFront
33
inputs:
4-
environment:
5-
description: Environment to deploy to
6-
default: 'integ'
74
artifact:
85
description: Name of the artifact
96
required: true
@@ -19,6 +16,9 @@ inputs:
1916
aws_bucket_name:
2017
description: The AWS bucket to sync
2118
required: true
19+
deploy_index_html:
20+
description: Deploy a simple index.html file to S3 root
21+
default: 'false'
2222
runs:
2323
using: 'composite'
2424

@@ -42,6 +42,40 @@ runs:
4242
shell: bash
4343
run: aws s3 sync ./download s3://${{ inputs.aws_bucket_name }}
4444

45+
- name: Create and Deploy Index HTML
46+
if: ${{ inputs.deploy_index_html == 'true' }}
47+
shell: bash
48+
run: |
49+
echo '<!DOCTYPE html>
50+
<html lang="en">
51+
<head>
52+
<meta charset="UTF-8">
53+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
54+
<title>UID2/EUID SDK Files</title>
55+
<style>
56+
body { font-family: Arial, sans-serif; margin: 40px; }
57+
h1 { color: #333; }
58+
.file-list { margin: 20px 0; }
59+
.file-item { margin: 10px 0; padding: 10px; background: #f5f5f5; border-radius: 5px; }
60+
.file-link { text-decoration: none; color: #0066cc; font-weight: bold; }
61+
.file-link:hover { text-decoration: underline; }
62+
</style>
63+
</head>
64+
<body>
65+
<h1>UID2/EUID SDK Files</h1>
66+
<p>This directory contains the latest SDK files for UID2 and EUID integration.</p>
67+
<div class="file-list">
68+
<div class="file-item">
69+
<strong>SDK Files:</strong> Available in this directory
70+
</div>
71+
<div class="file-item">
72+
<strong>Documentation:</strong> <a href="https://unifiedid.com/docs/guides/summary-guides" target="_blank" class="file-link">Visit Documentation</a>
73+
</div>
74+
</div>
75+
</body>
76+
</html>' > index.html
77+
aws s3 cp index.html s3://${{ inputs.aws_bucket_name }}/index.html
78+
4579
- name: Invalidate CloudFront
4680
uses: chetan/invalidate-cloudfront-action@v2
4781
env:

.github/workflows/node.js.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ jobs:
3232
- run: npm test
3333
working-directory: ${{ env.WORKING_DIR }}
3434
- name: Vulnerability Scan
35-
uses: IABTechLab/uid2-shared-actions/actions/vulnerability_scan_filesystem@v3
35+
uses: IABTechLab/uid2-shared-actions/actions/vulnerability_scan@v3
36+
with:
37+
scan_type: 'fs'
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
name: Release SDK to NPM and CDN (v2)
2+
run-name: ${{ inputs.release_type == 'Snapshot' && 'Publish Pre-release' || format('Release {0}', inputs.release_type)}} SDK Package to NPM and CDN by @${{ github.actor }}
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
release_type:
8+
type: choice
9+
description: The type of release
10+
options:
11+
- Major
12+
- Minor
13+
- Patch
14+
- Snapshot
15+
required: true
16+
with_tag:
17+
description: By default, running npm publish will tag your package with the latest dist-tag. To use another dist-tag, please add tag here
18+
required: false
19+
publish_to_npm:
20+
type: boolean
21+
description: Publish package to NPM (In general, always release to both)
22+
required: false
23+
default: true
24+
publish_to_cdn:
25+
type: boolean
26+
description: Publish package to CDN (In general, always release to both)
27+
required: false
28+
default: true
29+
30+
jobs:
31+
incrementVersionNumber:
32+
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-increase-version-number.yaml@v2
33+
with:
34+
release_type: ${{ inputs.release_type }}
35+
secrets: inherit
36+
37+
build:
38+
runs-on: ubuntu-latest
39+
needs: [incrementVersionNumber]
40+
strategy:
41+
matrix:
42+
node-version: [20.x]
43+
target: [development, production]
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
48+
- name: Use Node.js ${{ matrix.node-version }}
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: ${{ matrix.node-version }}
52+
- name: Get Package Version
53+
id: version
54+
run: |
55+
echo "package_version=$(cat package.json | jq -r '.version')" >> $GITHUB_OUTPUT
56+
- name: Install dependencies
57+
run: npm install
58+
- name: Build script
59+
run: npm run build -- --mode=${{ matrix.target }}
60+
- uses: actions/upload-artifact@v4
61+
if: inputs.publish_to_cdn
62+
with:
63+
name: uid2SDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
64+
path: ./dist/uid2-sdk-${{ steps.version.outputs.package_version }}.js
65+
- uses: actions/upload-artifact@v4
66+
if: inputs.publish_to_cdn
67+
with:
68+
name: euidSDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
69+
path: ./dist/euid-sdk-${{ steps.version.outputs.package_version }}.js
70+
outputs:
71+
sdkVersion: ${{ steps.version.outputs.package_version }}
72+
73+
createNpmJsRelease:
74+
needs: [incrementVersionNumber, build]
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Build Changelog
78+
id: github_release_changelog
79+
uses: mikepenz/release-changelog-builder-action@v4
80+
with:
81+
toTag: v${{ needs.incrementVersionNumber.outputs.new_version }}
82+
configurationJson: |
83+
{
84+
"pr_template": " - #{{TITLE}} - ( PR: ##{{NUMBER}} )"
85+
}
86+
- name: Create Release Notes
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
name: v${{ needs.incrementVersionNumber.outputs.new_version }}
90+
body: ${{ steps.github_release_changelog.outputs.changelog }}
91+
draft: true
92+
93+
publish-package:
94+
if: inputs.publish_to_npm
95+
needs: [build, incrementVersionNumber]
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
with:
100+
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
101+
- uses: actions/setup-node@v4
102+
with:
103+
node-version: '20.x'
104+
registry-url: 'https://registry.npmjs.org'
105+
scope: uid2
106+
- run: npm ci
107+
- name: Build package
108+
run: npm run build-package
109+
- name: Publish Latest package
110+
if: ${{!github.event.inputs.with_tag}}
111+
run: |
112+
npm publish ./dist/uid2-npm --access public
113+
npm publish ./dist/euid-npm --access public
114+
env:
115+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
116+
- name: Publish Latest package with tag
117+
if: ${{github.event.inputs.with_tag}}
118+
run: |
119+
npm publish ./dist/uid2-npm --tag ${{github.event.inputs.with_tag}} --access public
120+
npm publish ./dist/euid-npm --tag ${{github.event.inputs.with_tag}} --access public
121+
env:
122+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
123+
124+
# Test Environment - UID2 only first
125+
cdn-deployment-test:
126+
if: inputs.publish_to_cdn
127+
needs: [build, incrementVersionNumber]
128+
runs-on: ubuntu-latest
129+
permissions:
130+
id-token: write
131+
environment: uid2-test
132+
steps:
133+
- uses: actions/checkout@v4
134+
with:
135+
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
136+
- uses: ./.github/actions/cdn_deployment_aws
137+
with:
138+
artifact: uid2SDK-development-${{ needs.build.outputs.sdkVersion}}
139+
invalidate_paths: '/uid2-sdk-${{ needs.build.outputs.sdkVersion}}.js'
140+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
141+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
142+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
143+
deploy_index_html: 'true'
144+
145+
approval-to-deploy:
146+
name: Approval To Deploy
147+
needs: [cdn-deployment-test]
148+
runs-on: ubuntu-latest
149+
environment: approve-deployment
150+
steps:
151+
- name: Approval to deploy
152+
shell: bash
153+
run: echo "Approved"
154+
155+
# Consolidated CDN Deployment with Matrix
156+
cdn-deployment:
157+
if: inputs.publish_to_cdn
158+
needs: [build, incrementVersionNumber, approval-to-deploy]
159+
runs-on: ubuntu-latest
160+
permissions:
161+
id-token: write
162+
strategy:
163+
matrix:
164+
include:
165+
# UID2 Environments
166+
- product: uid2
167+
github_env: uid2-integ
168+
build_type: development
169+
- product: uid2
170+
github_env: uid2-prod
171+
build_type: production
172+
# EUID Environments
173+
- product: euid
174+
github_env: euid-integ
175+
build_type: development
176+
- product: euid
177+
github_env: euid-prod
178+
build_type: production
179+
environment: ${{ matrix.github_env }}
180+
steps:
181+
- uses: actions/checkout@v4
182+
with:
183+
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
184+
- uses: ./.github/actions/cdn_deployment_aws
185+
with:
186+
artifact: ${{ matrix.product }}SDK-${{ matrix.build_type }}-${{ needs.build.outputs.sdkVersion}}
187+
invalidate_paths: '/${{ matrix.product }}-sdk-${{ needs.build.outputs.sdkVersion}}.js'
188+
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
189+
aws_bucket_name: ${{ secrets.S3_BUCKET }}
190+
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
191+
deploy_index_html: 'true'

.github/workflows/release-secure-signal-examples-docker-image-server-only.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
release_type: ${{ inputs.release_type }}
3131
docker_file: examples/google-secure-signals-integration/server_side/Dockerfile
3232
docker_context: examples/google-secure-signals-integration/server_side
33-
docker_image_name: iabtechlab/uid2-secure-signals-example-srvonly
33+
docker_image_name: iabtechlab/uid2-esp-example-srvonly
3434
docker_registry: ghcr.io
3535
force_release: no
3636
secrets: inherit

.github/workflows/release-secure-signal-examples-docker-image-standard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
release_type: ${{ inputs.release_type }}
3131
docker_file: examples/google-secure-signals-integration/with_sdk_v3/Dockerfile
3232
docker_context: examples/google-secure-signals-integration/with_sdk_v3
33-
docker_image_name: iabtechlab/uid2-secure-signals-example-jssdk
33+
docker_image_name: iabtechlab/uid2-esp-example-jssdk
3434
docker_registry: ghcr.io
3535
force_release: no
3636
secrets: inherit

.github/workflows/secureSignal-cd.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ jobs:
7474
- name: Deploy UID2 Secure Signals to CDN
7575
uses: ./.github/actions/cdn_deployment_aws
7676
with:
77-
environment: ${{ matrix.environment }}
7877
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}Uid2SecureSignalScript
7978
invalidate_paths: '/uid2SecureSignal.js'
8079
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
@@ -83,7 +82,6 @@ jobs:
8382
- name: Deploy EUID Secure Signals to CDN
8483
uses: ./.github/actions/cdn_deployment_aws
8584
with:
86-
environment: ${{ matrix.environment }}
8785
artifact: ${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}EuidSecureSignalScript
8886
invalidate_paths: '/euidSecureSignal.js'
8987
aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }}

0 commit comments

Comments
 (0)