Skip to content

Commit 9df9efd

Browse files
committed
Merge branch 'main' of https://github.com/aws-observability/aws-otel-js-instrumentation into clean-release-lambda-changes
2 parents a21f235 + dafa968 commit 9df9efd

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

.github/workflows/release-build.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ env:
1919
RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com
2020
PACKAGE_NAME: aws-distro-opentelemetry-node-autoinstrumentation
2121
ARTIFACT_NAME: aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz
22-
COMMERCIAL_REGIONS: us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-3, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1, sa-east-1, ap-southeast-5, ap-southeast-7, mx-central-1, ca-west-1, cn-north-1, cn-northwest-1
22+
# Legacy list of commercial regions to deploy to. New regions should NOT be added here, and instead should be added to the `aws_region` default input to the workflow.
23+
LEGACY_COMMERCIAL_REGIONS: us-east-1, us-east-2, us-west-1, us-west-2, ap-south-1, ap-northeast-3, ap-northeast-2, ap-southeast-1, ap-southeast-2, ap-northeast-1, ca-central-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1, sa-east-1
2324
LAYER_NAME: AWSOpenTelemetryDistroJs
2425

2526
permissions:
@@ -34,6 +35,24 @@ jobs:
3435
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
3536
uses: actions/checkout@v4
3637

38+
- name: Check main build status
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
WORKFLOW_ID=$(gh api repos/${{ github.repository }}/actions/workflows --jq '.workflows[] | select(.name=="NodeJS Instrumentation Main Build") | .id')
43+
LATEST_RUN=$(gh api repos/${{ github.repository }}/actions/workflows/$WORKFLOW_ID/runs --jq '[.workflow_runs[] | select(.head_branch=="${{ github.ref_name }}")] | sort_by(.created_at) | .[-1] | {conclusion, status}')
44+
STATUS=$(echo "$LATEST_RUN" | jq -r '.status')
45+
CONCLUSION=$(echo "$LATEST_RUN" | jq -r '.conclusion')
46+
47+
if [ "$STATUS" = "in_progress" ] || [ "$STATUS" = "queued" ]; then
48+
echo "Main build is still running (status: $STATUS). Cannot proceed with release."
49+
exit 1
50+
elif [ "$CONCLUSION" != "success" ]; then
51+
echo "Latest main build on branch ${{ github.ref_name }} conclusion: $CONCLUSION"
52+
exit 1
53+
fi
54+
echo "Main build succeeded, proceeding with release"
55+
3756
- name: Build Tarball and Image Files
3857
uses: ./.github/actions/artifacts_build
3958
with:
@@ -186,21 +205,21 @@ jobs:
186205
steps:
187206
- name: role arn
188207
env:
189-
COMMERCIAL_REGIONS: ${{ env.COMMERCIAL_REGIONS }}
208+
LEGACY_COMMERCIAL_REGIONS: ${{ env.LEGACY_COMMERCIAL_REGIONS }}
190209
run: |
191-
COMMERCIAL_REGIONS_ARRAY=(${COMMERCIAL_REGIONS//,/ })
210+
LEGACY_COMMERCIAL_REGIONS_ARRAY=(${LEGACY_COMMERCIAL_REGIONS//,/ })
192211
FOUND=false
193-
for REGION in "${COMMERCIAL_REGIONS_ARRAY[@]}"; do
212+
for REGION in "${LEGACY_COMMERCIAL_REGIONS_ARRAY[@]}"; do
194213
if [[ "$REGION" == "${{ matrix.aws_region }}" ]]; then
195214
FOUND=true
196215
break
197216
fi
198217
done
199218
if [ "$FOUND" = true ]; then
200-
echo "Found ${{ matrix.aws_region }} in COMMERCIAL_REGIONS"
219+
echo "Found ${{ matrix.aws_region }} in LEGACY_COMMERCIAL_REGIONS"
201220
SECRET_KEY="LAMBDA_LAYER_RELEASE"
202221
else
203-
echo "Not found ${{ matrix.aws_region }} in COMMERCIAL_REGIONS"
222+
echo "Not found ${{ matrix.aws_region }} in LEGACY_COMMERCIAL_REGIONS"
204223
SECRET_KEY="${{ matrix.aws_region }}_LAMBDA_LAYER_RELEASE"
205224
fi
206225
SECRET_KEY=${SECRET_KEY//-/_}

lambda-layer/sample-apps/aws-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"typescript": "4.9.5"
5252
},
5353
"dependencies": {
54-
"@aws-sdk/client-s3": "^3.651.1"
54+
"@aws-sdk/client-s3": "3.651.1"
5555
}
5656
}

0 commit comments

Comments
 (0)