|
1 |
| -name: "Build AWS Lambda Extension" |
2 |
| -description: "Creates a packaged Lambda layer including the Sentry Lambda extension." |
| 1 | +name: "Build AWS Lambda Layer" |
| 2 | +description: "Creates a Lambda layer including the Sentry SDK and the Sentry Lambda extension." |
3 | 3 | inputs:
|
4 | 4 | artifact_name:
|
5 |
| - description: Name of the prepared articact to package into an Lambda extension |
| 5 | + description: Name of the prepared articact the Lambda Layer zip file should be uploaded to |
6 | 6 | required: true
|
7 | 7 | zip_file_name:
|
8 | 8 | description: Name of the zip file that will be created
|
9 | 9 | required: true
|
10 |
| - preserve_symlinks: |
11 |
| - description: Should symbolic links be preserved in the .zip file |
12 |
| - required: false |
13 |
| - default: false |
14 |
| - build_cache_path: |
15 |
| - description: Paths of the build cache |
16 |
| - required: true |
17 | 10 | build_cache_key:
|
18 | 11 | description: Build cache key
|
19 | 12 | required: true
|
| 13 | + build_cache_paths: |
| 14 | + description: Paths of the build cache |
| 15 | + required: true |
20 | 16 | runs:
|
21 | 17 | using: "composite"
|
22 | 18 | steps:
|
23 | 19 | - name: Check build cache
|
24 | 20 | uses: actions/cache@v2
|
25 | 21 | id: cache_built_packages
|
26 | 22 | with:
|
27 |
| - path: ${{ inputs.build_cache_path }} |
| 23 | + path: ${{ inputs.build_cache_paths }} |
28 | 24 | key: ${{ inputs.build_cache_key }}
|
29 |
| - # - uses: actions/download-artifact@v3 |
30 |
| - # with: |
31 |
| - # name: ${{ inputs.artifact_name }} |
32 |
| - - name: Setup tmate session |
33 |
| - uses: mxschmitt/action-tmate@v3 |
34 |
| - - name: Download and configure extension |
| 25 | + - name: Download and configure Sentry Lambda extension |
35 | 26 | shell: bash
|
36 | 27 | run: |
|
37 |
| - echo "Downloading extension..." |
| 28 | + echo "Downloading Sentry Lambda extension..." |
38 | 29 | mkdir -p dist-serverless/extensions
|
39 | 30 | curl -0 --silent --output dist-serverless/extensions/sentry-lambda-extension `curl -s https://release-registry.services.sentry.io/apps/sentry-lambda-extension/latest | jq -r .files.\"sentry-lambda-extension\".url`
|
40 | 31 | chmod +x dist-serverless/extensions/sentry-lambda-extension
|
41 |
| - - name: Check for symlink |
42 |
| - shell: bash |
43 |
| - run: | |
44 |
| - echo "--------------------" |
45 |
| - ls -laR packages/serverless/build/aws/dist-serverless/ |
46 |
| - echo " XXX packages/serverless/build/aws/dist-serverless/nodejs/node_modules/@sentry/serverless/dist should be a symlink" |
47 |
| - echo "--------------------" |
48 |
| - - name: Zip directory |
| 32 | + echo "Done downloading Sentry Lambda extension..." |
| 33 | + - name: Create Lambda Layer zip |
49 | 34 | shell: bash
|
50 | 35 | run: |
|
51 | 36 | echo "Creating ${{ inputs.zip_file_name }}..."
|
52 |
| - echo "${{ inputs.preserve_symlinks }}" |
53 |
| - echo "${{ inputs.preserve_symlinks && '-y' }}" |
54 | 37 | cd dist-serverless
|
55 |
| - zip -r ${{ inputs.preserve_symlinks && '-y' }} ../${{ inputs.zip_file_name }} . --exclude \*__pycache__\* --exclude \*.yml |
| 38 | + # preserving symlinks with -y is important for Node based Layers! |
| 39 | + zip -r -y ../${{ inputs.zip_file_name }} . --exclude \*__pycache__\* --exclude \*.yml |
56 | 40 | cd ..
|
57 | 41 | echo "Done creating ${{ inputs.zip_file_name }}."
|
58 | 42 |
|
59 |
| - echo "Contents of the created ZIP file:" |
| 43 | + echo "Contents of the created zip file:" |
60 | 44 | unzip -Z ${{ inputs.zip_file_name }}
|
61 |
| - - name: Upload zip |
| 45 | + - name: Upload zip (will be picked up by Craft for deployment) |
62 | 46 | uses: actions/upload-artifact@v3
|
63 | 47 | with:
|
64 | 48 | name: ${{ inputs.artifact_name }}
|
|
0 commit comments