Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create "latest" sdk files #131

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
57 changes: 45 additions & 12 deletions .github/workflows/publish-package-to-npmjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
description: Publish package to CDN (In general, always release to both)
required: false
default: true
release_latest_version:
type: number
description: Release a latest major version (*-[majorVersion]-latest.js)
required: false
default: false
jobs:
incrementVersionNumber:
uses: IABTechLab/uid2-shared-actions/.github/workflows/shared-increase-version-number.yaml@v2
Expand All @@ -37,7 +42,7 @@ jobs:
needs: [incrementVersionNumber]
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
target: [development, production]
steps:
Expand All @@ -56,16 +61,26 @@ jobs:
run: npm install
- name: Build script
run: npm run build -- --mode=${{ matrix.target }}
# - uses: actions/upload-artifact@v4
# if: inputs.publish_to_cdn
# with:
# name: uid2SDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
# path: ./dist/uid2-sdk-${{ steps.version.outputs.package_version }}.js
- uses: actions/upload-artifact@v4
if: inputs.publish_to_cdn
if: inputs.release_latest_version
with:
name: uid2SDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
path: ./dist/uid2-sdk-${{ steps.version.outputs.package_version }}.js
name: uid2SDK-${{ matrix.target }}-v${{inputs.release_latest_version}}-latest
path: ./dist/uid2-sdk-latest.js
# - uses: actions/upload-artifact@v4
# if: inputs.publish_to_cdn
# with:
# name: euidSDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
# path: ./dist/euid-sdk-${{ steps.version.outputs.package_version }}.js
- uses: actions/upload-artifact@v4
if: inputs.publish_to_cdn
if: inputs.release_latest_version
with:
name: euidSDK-${{ matrix.target }}-${{ steps.version.outputs.package_version }}
path: ./dist/euid-sdk-${{ steps.version.outputs.package_version }}.js
name: euidSDK-${{ matrix.target }}-v${{inputs.release_latest_version}}-latest
path: ./dist/euid-sdk-latest.js
outputs:
sdkVersion: ${{ steps.version.outputs.package_version }}
publish-package:
Expand All @@ -78,7 +93,7 @@ jobs:
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
scope: uid2
- run: npm ci
Expand Down Expand Up @@ -112,11 +127,20 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
# - uses: ./.github/actions/cdn_deployment_aws
# with:
# environment: ${{ matrix.environment }}
# artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}}
# invalidate_paths: '/uid2-sdk-${{ needs.build.outputs.sdkVersion}}.js'
# aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
# aws_bucket_name: ${{ vars.S3_BUCKET }}
# aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
- uses: ./.github/actions/cdn_deployment_aws
if: inputs.release_latest_version
with:
environment: ${{ matrix.environment }}
artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}}
invalidate_paths: '/uid2-sdk-${{ needs.build.outputs.sdkVersion}}.js'
artifact: uid2SDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-v${{inputs.release_latest_version}}-latest
invalidate_paths: '/uid2-sdk-v${{inputs.release_latest_version}}-latest.js'
aws_account_id: ${{ vars.AWS_ACCOUNT_ID }}
aws_bucket_name: ${{ vars.S3_BUCKET }}
aws_distribution_id: ${{ secrets.AWS_DISTRIBUTION_ID }}
Expand All @@ -134,11 +158,20 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.incrementVersionNumber.outputs.git_tag_or_hash }}
# - uses: ./.github/actions/cdn_deployment_aws
# with:
# environment: ${{ matrix.environment }}
# artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}}
# invalidate_paths: '/euid-sdk-${{ needs.build.outputs.sdkVersion}}.js'
# aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }}
# aws_bucket_name: ${{ vars.EUID_S3_BUCKET }}
# aws_distribution_id: ${{ secrets.EUID_AWS_DISTRIBUTION_ID }}
- uses: ./.github/actions/cdn_deployment_aws
if: inputs.release_latest_version
with:
environment: ${{ matrix.environment }}
artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-${{ needs.build.outputs.sdkVersion}}
invalidate_paths: '/euid-sdk-${{ needs.build.outputs.sdkVersion}}.js'
artifact: euidSDK-${{ (matrix.environment == 'integ' && 'development') || matrix.environment }}-v${{inputs.release_latest_version}}-latest
invalidate_paths: '/euid-sdk-v${{inputs.release_latest_version}}-latest.js'
aws_account_id: ${{ vars.EUID_AWS_ACCOUNT_ID }}
aws_bucket_name: ${{ vars.EUID_S3_BUCKET }}
aws_distribution_id: ${{ secrets.EUID_AWS_DISTRIBUTION_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/secureSignal-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
target: [development, production]

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uid2/uid2-sdk",
"version": "3.10.0",
"version": "3.10.19-SNAPSHOT",
"description": "UID2 Client SDK",
"author": "The Trade Desk",
"repository": {
Expand All @@ -27,7 +27,7 @@
"localtest": "cd localtest && tsx server.ts"
},
"engines": {
"node": ">=18"
"node": ">=20"
},
"jest": {
"preset": "ts-jest",
Expand Down
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@ module.exports = (env, argv) => {
import: uid2Entrypoint,
filename: `uid2-sdk-${process.env.npm_package_version}.js`,
},
'uid2-sdk-latest': {
import: uid2Entrypoint,
filename: `uid2-sdk-latest.js`,
},
'euid-sdk': {
import: euidEntrypoint,
filename: `euid-sdk-${process.env.npm_package_version}.js`,
},
'euid-sdk-latest': {
import: euidEntrypoint,
filename: `euid-sdk-latest.js`,
},
...getExampleOutputs(env),
}
: espOutput,
Expand Down