-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·61 lines (52 loc) · 1.78 KB
/
publish.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
set -e
# Source version configuration
source "$(dirname "$0")/version.sh"
# Determine the base directory (for CI or local execution)
BASE_DIR="${BASE_DIR:-$(pwd)}"
echo "Publishing Ghostscript ${GHOSTSCRIPT_VERSION} layers..."
# Publish x86_64 layer
echo "Publishing x86_64 layer..."
LAYER_NAME='ghostscript'
LAYER_VERSION_X86=$(
aws lambda publish-layer-version --region "$TARGET_REGION" \
--layer-name $LAYER_NAME \
--zip-file fileb://${BASE_DIR}/ghostscript-x86_64.zip \
--description "Ghostscript v${GHOSTSCRIPT_VERSION} (x86_64)" \
--compatible-architectures "x86_64" \
--query Version \
--output text
)
aws lambda add-layer-version-permission \
--region "$TARGET_REGION" \
--layer-name $LAYER_NAME \
--statement-id public-access-x86 \
--action lambda:GetLayerVersion \
--principal '*' \
--query Statement \
--output text \
--version-number "$LAYER_VERSION_X86"
echo "Published ${LAYER_NAME} version ${LAYER_VERSION_X86} (x86_64)"
# Publish ARM64 layer
echo "Publishing ARM64 layer..."
LAYER_NAME_ARM='ghostscript-arm64'
LAYER_VERSION_ARM=$(
aws lambda publish-layer-version --region "$TARGET_REGION" \
--layer-name $LAYER_NAME_ARM \
--zip-file fileb://${BASE_DIR}/ghostscript-arm64.zip \
--description "Ghostscript v${GHOSTSCRIPT_VERSION} (ARM64)" \
--compatible-architectures "arm64" \
--query Version \
--output text
)
aws lambda add-layer-version-permission \
--region "$TARGET_REGION" \
--layer-name $LAYER_NAME_ARM \
--statement-id public-access-arm64 \
--action lambda:GetLayerVersion \
--principal '*' \
--query Statement \
--output text \
--version-number "$LAYER_VERSION_ARM"
echo "Published ${LAYER_NAME_ARM} version ${LAYER_VERSION_ARM} (ARM64)"
echo "All layers published successfully!"