|
31 | 31 | ${{ github.workspace }}/packages/ember/*.d.ts |
32 | 32 | ${{ github.workspace }}/packages/ember/instance-initializers |
33 | 33 | ${{ github.workspace }}/packages/gatsby/*.d.ts |
34 | | - ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip |
| 34 | + ${{ github.workspace }}/packages/core/src/version.ts |
| 35 | + ${{ github.workspace }}/dist-serverless |
35 | 36 |
|
36 | 37 | BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }} |
37 | 38 |
|
@@ -99,6 +100,11 @@ jobs: |
99 | 100 | # this file) to a constant and skip rebuilding all of the packages each time CI runs. |
100 | 101 | if: steps.cache_built_packages.outputs.cache-hit == '' |
101 | 102 | run: yarn build |
| 103 | + - name: Save SDK version for later |
| 104 | + run: | |
| 105 | + echo "Saving SDK_VERSION for later" |
| 106 | + export SDK_VERSION=$(cat packages/core/src/version.ts | cut -f5 -d' ' | tr -d "'" | tr -d ";") |
| 107 | + echo $SDK_VERSION > dist-serverless/version |
102 | 108 | outputs: |
103 | 109 | # this needs to be passed on, because the `needs` context only looks at direct ancestors (so steps which depend on |
104 | 110 | # `job_build` can't see `job_install_deps` and what it returned) |
@@ -228,7 +234,6 @@ jobs: |
228 | 234 | ${{ github.workspace }}/packages/integrations/build/bundles/** |
229 | 235 | ${{ github.workspace }}/packages/tracing/build/bundles/** |
230 | 236 | ${{ github.workspace }}/packages/**/*.tgz |
231 | | - ${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip |
232 | 237 |
|
233 | 238 | job_unit_test: |
234 | 239 | name: Test (Node ${{ matrix.node }}) |
@@ -315,10 +320,10 @@ jobs: |
315 | 320 | uses: actions/checkout@v2 |
316 | 321 | with: |
317 | 322 | ref: ${{ env.HEAD_COMMIT }} |
318 | | - # TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description, |
319 | | - # so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to |
320 | | - # tell if it's safe to remove. Once ember tests are fixed, let's try again with it turned off, and if all goes |
321 | | - # well, we can pull it out. |
| 323 | + # TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description, |
| 324 | + # so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to |
| 325 | + # tell if it's safe to remove. Once ember tests are fixed, let's try again with it turned off, and if all goes |
| 326 | + # well, we can pull it out. |
322 | 327 | fetch-depth: 0 |
323 | 328 | - name: Set up Node |
324 | 329 | uses: actions/setup-node@v1 |
@@ -501,3 +506,41 @@ jobs: |
501 | 506 | run: | |
502 | 507 | cd packages/node-integration-tests |
503 | 508 | yarn test |
| 509 | +
|
| 510 | + job_build_aws_lambda_layer: |
| 511 | + name: Build AWS Lambda Layer |
| 512 | + needs: job_build |
| 513 | + runs-on: ubuntu-latest |
| 514 | + steps: |
| 515 | + - name: Check out current commit (${{ env.HEAD_COMMIT }}) |
| 516 | + uses: actions/checkout@v2 |
| 517 | + with: |
| 518 | + ref: ${{ env.HEAD_COMMIT }} |
| 519 | + - name: Set up Node |
| 520 | + uses: actions/setup-node@v1 |
| 521 | + with: |
| 522 | + node-version: ${{ env.DEFAULT_NODE_VERSION }} |
| 523 | + - name: Check dependency cache |
| 524 | + uses: actions/cache@v2 |
| 525 | + with: |
| 526 | + path: ${{ env.CACHED_DEPENDENCY_PATHS }} |
| 527 | + key: ${{ needs.job_build.outputs.dependency_cache_key }} |
| 528 | + - name: Check build cache |
| 529 | + uses: actions/cache@v2 |
| 530 | + with: |
| 531 | + path: ${{ env.CACHED_BUILD_PATHS }} |
| 532 | + key: ${{ env.BUILD_CACHE_KEY }} |
| 533 | + - name: Get SDK version |
| 534 | + run: | |
| 535 | + export SDK_VERSION=$(cat dist-serverless/version) |
| 536 | + echo "SDK_VERSION=$SDK_VERSION" |
| 537 | + echo "SDK_VERSION=$SDK_VERSION" >> $GITHUB_ENV |
| 538 | + - uses: actions/upload-artifact@v3 |
| 539 | + with: |
| 540 | + name: ${{ env.HEAD_COMMIT }} |
| 541 | + path: | |
| 542 | + dist-serverless/* |
| 543 | + - uses: getsentry/action-build-aws-lambda-extension@v1 |
| 544 | + with: |
| 545 | + artifact_name: ${{ env.HEAD_COMMIT }} |
| 546 | + zip_file_name: sentry-node-serverless-${{ env.SDK_VERSION }}.zip |
0 commit comments