|
19 | 19 | RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com |
20 | 20 | PACKAGE_NAME: aws-distro-opentelemetry-node-autoinstrumentation |
21 | 21 | 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 |
23 | 24 | LAYER_NAME: AWSOpenTelemetryDistroJs |
24 | 25 |
|
25 | 26 | permissions: |
|
34 | 35 | - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} |
35 | 36 | uses: actions/checkout@v4 |
36 | 37 |
|
| 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 | +
|
37 | 56 | - name: Build Tarball and Image Files |
38 | 57 | uses: ./.github/actions/artifacts_build |
39 | 58 | with: |
@@ -186,21 +205,21 @@ jobs: |
186 | 205 | steps: |
187 | 206 | - name: role arn |
188 | 207 | env: |
189 | | - COMMERCIAL_REGIONS: ${{ env.COMMERCIAL_REGIONS }} |
| 208 | + LEGACY_COMMERCIAL_REGIONS: ${{ env.LEGACY_COMMERCIAL_REGIONS }} |
190 | 209 | run: | |
191 | | - COMMERCIAL_REGIONS_ARRAY=(${COMMERCIAL_REGIONS//,/ }) |
| 210 | + LEGACY_COMMERCIAL_REGIONS_ARRAY=(${LEGACY_COMMERCIAL_REGIONS//,/ }) |
192 | 211 | FOUND=false |
193 | | - for REGION in "${COMMERCIAL_REGIONS_ARRAY[@]}"; do |
| 212 | + for REGION in "${LEGACY_COMMERCIAL_REGIONS_ARRAY[@]}"; do |
194 | 213 | if [[ "$REGION" == "${{ matrix.aws_region }}" ]]; then |
195 | 214 | FOUND=true |
196 | 215 | break |
197 | 216 | fi |
198 | 217 | done |
199 | 218 | if [ "$FOUND" = true ]; then |
200 | | - echo "Found ${{ matrix.aws_region }} in COMMERCIAL_REGIONS" |
| 219 | + echo "Found ${{ matrix.aws_region }} in LEGACY_COMMERCIAL_REGIONS" |
201 | 220 | SECRET_KEY="LAMBDA_LAYER_RELEASE" |
202 | 221 | else |
203 | | - echo "Not found ${{ matrix.aws_region }} in COMMERCIAL_REGIONS" |
| 222 | + echo "Not found ${{ matrix.aws_region }} in LEGACY_COMMERCIAL_REGIONS" |
204 | 223 | SECRET_KEY="${{ matrix.aws_region }}_LAMBDA_LAYER_RELEASE" |
205 | 224 | fi |
206 | 225 | SECRET_KEY=${SECRET_KEY//-/_} |
|
0 commit comments