Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/alpha-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ jobs:
id: version-and-tag
run: |
PKG_VERSION=$(jq -r .version package.json)
DATE=$(date +%Y%m%d%H%M)
TAG="v${PKG_VERSION}-${DATE}-alpha"
REF="${{ inputs.ref || 'main' }}"

if [[ "$REF" == "main" ]]; then
TAG="v${PKG_VERSION}-alpha"
else
SAFE_REF=$(echo "$REF" | sed 's/[^a-zA-Z0-9]/-/g')
TAG="v${PKG_VERSION}-${SAFE_REF}-alpha"
fi

git tag "$TAG"
git push origin "$TAG"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
run: |
PKG_VERSION=$(jq -r .version package.json)

FULL_TAG="v${PKG_VERSION}-beta"
git tag "$FULL_TAG"
git push origin "$FULL_TAG"
TAG="v${PKG_VERSION}-beta"
git tag "$TAG"
git push origin "$TAG"
echo "Created tag from branch=$(git rev-parse --abbrev-ref HEAD), commit=$(git rev-parse HEAD), tag=$(git describe --tags --exact-match)"

echo "tag=$FULL_TAG" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

call-release:
needs: [create-beta-tag]
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ jobs:
if [[ "$TAG" == "v$VERSION" ]]; then
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "is-prerelease=false" >> $GITHUB_OUTPUT
elif [[ "$TAG" =~ ^v$VERSION-[0-9]{12}-alpha$ ]]; then
elif [[ "$TAG" =~ ^v$VERSION-.*-alpha$ ]]; then
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "is-prerelease=true" >> $GITHUB_OUTPUT
elif [[ "$TAG" == "v$VERSION-alpha" ]]; then
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "is-prerelease=true" >> $GITHUB_OUTPUT
elif [[ "$TAG" =~ ^v$VERSION-beta$ ]]; then
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "is-prerelease=true" >> $GITHUB_OUTPUT
else
echo "Error: Tag ($TAG) must be v$VERSION, v$VERSION-yyyymmddhhmm-alpha, or v$VERSION-beta"
echo "Error: Tag ($TAG) must be v$VERSION, v$VERSION-alpha, v$VERSION-<branch>-alpha, or v$VERSION-beta"
exit 1
fi

Expand Down Expand Up @@ -145,11 +148,11 @@ jobs:

TAG="${{ needs.version-and-tag.outputs.tag }}"
if [[ "$TAG" =~ -alpha$ ]]; then
npm run bundle:alpha -- --env rebuild=true
npm run bundle:alpha -- --env rebuild=true --env buildTarget=legacy
elif [[ "$TAG" =~ -beta$ ]]; then
npm run bundle:beta -- --env rebuild=true
npm run bundle:beta -- --env rebuild=true --env buildTarget=legacy
else
npm run bundle:prod -- --env rebuild=true
npm run bundle:prod -- --env rebuild=true --env buildTarget=legacy
fi

if [ -z "$(find . -name "*.node" -print -quit)" ]; then
Expand Down
4 changes: 3 additions & 1 deletion src/telemetry/OTELInstrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ export function otelSdk(clientId: string, client?: ClientInfo) {
exportIntervalMillis: ExportIntervalSeconds * 1000,
});

const buildTarget = process.env.BUILD_TARGET ? `-${process.env.BUILD_TARGET}` : '';

const sdk = new NodeSDK({
resource: resourceFromAttributes({
['service']: `${ExtensionId}-${ExtensionVersion}`,
['service.env']: `${process.env.NODE_ENV}-${process.env.AWS_ENV}`,
['client.id']: clientId,
['client.type']: `${client?.name ?? 'Unknown'}-${client?.version ?? 'Unknown'}`,
['machine.type']: `${type()}-${platform()}-${arch()}-${machine()}-${release()}`,
['process.type']: `${process.platform}-${process.arch}`,
['process.type']: `${process.platform}${buildTarget}-${process.arch}`,
['process.version']: `node=${process.versions.node} v8=${process.versions.v8} uv=${process.versions.uv} modules=${process.versions.modules}`,
}),
resourceDetectors: [],
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function generateExternals() {

const EXTERNALS = generateExternals();

function createPlugins(isDevelopment, outputPath, mode, env, rebuild = false) {
function createPlugins(isDevelopment, outputPath, mode, env, rebuild = false, buildTarget = '') {
const plugins = [];

plugins.push(
Expand Down Expand Up @@ -222,6 +222,7 @@ function createPlugins(isDevelopment, outputPath, mode, env, rebuild = false) {
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(mode),
'process.env.AWS_ENV': JSON.stringify(env),
'process.env.BUILD_TARGET': JSON.stringify(buildTarget),
}),
);

Expand Down Expand Up @@ -276,6 +277,7 @@ module.exports = (env = {}) => {
const mode = env.mode;
let awsEnv = env.env;
const rebuild = env.rebuild === 'true' || env.rebuild === true;
const buildTarget = env.buildTarget || '';

// Validate mode
const validModes = ['development', 'production'];
Expand Down Expand Up @@ -329,6 +331,6 @@ module.exports = (env = {}) => {
chunks: 'all',
},
},
plugins: createPlugins(isDevelopment, outputPath, mode, awsEnv, rebuild),
plugins: createPlugins(isDevelopment, outputPath, mode, awsEnv, rebuild, buildTarget),
};
};
Loading