-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (60 loc) · 1.79 KB
/
upload.yaml
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
62
63
64
65
66
67
name: Upload assets
on:
workflow_call:
inputs:
global:
type: boolean
description: 'Upload to all supported regions'
default: false
concurrency:
type: number
description: 'Number of concurrenct jobs'
default: 4
s3_bucket_prefix:
type: string
description: 'S3 bucket prefix to upload SAM assets to'
required: true
release_version:
type: string
description: 'Release version to use. If omitted, version will be computed'
default: ''
outputs:
release_version:
description: "Release version used."
value: ${{ jobs.upload.outputs.release_version }}
env:
SAM_CLI_TELEMETRY: 0
jobs:
upload:
name: Package and upload SAM apps
runs-on: ubuntu-latest
permissions:
id-token: write
outputs:
release_version: ${{ steps.build.outputs.version }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Fetch tags for versioning
if: inputs.release_version == ''
run: git fetch --prune --unshallow --tags
- name: Setup AWS credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-west-2
- name: AWS Info
run: aws sts get-caller-identity
- name: Build and upload SAM apps
id: build
run: |
if [ "${{ inputs.global }}" = "true" ]; then
make sam-push
else
make sam-push-us-west-2
fi
echo "version=`make version`" >> $GITHUB_OUTPUT
env:
MAKEFLAGS: "-j ${{ inputs.concurrency }} --output-sync=target"
S3_BUCKET_PREFIX: "${{ inputs.s3_bucket_prefix }}"
RELEASE_VERSION: "${{ inputs.release_version }}"