-
Notifications
You must be signed in to change notification settings - Fork 5
97 lines (79 loc) · 2.56 KB
/
release.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
workflow_dispatch: {}
release:
types: [created]
env:
AWS_REGION: eu-west-1
SAR_ARTIFACT_BUCKET: ${{ secrets.SAR_ARTIFACT_BUCKET }}
jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: aws-actions/setup-sam@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_REPO_ROLE_ARN }}
aws-region: eu-west-1
- name: Install rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.10.0
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
- name: Install Cargo Lambda
uses: jaxxstorm/action-install-gh-release@v1.9.0
with:
repo: cargo-lambda/cargo-lambda
platform: linux
arch: x86_64
- name: Sam build
run: |
sam build
- name: Compress bootstrap
working-directory: .aws-sam/build/OidcAuthorizer
run: |
zip -9 bootstrap.zip bootstrap
- name: Upload bootstrap.zip to (existing) GitHub release
uses: xresloader/upload-to-github-release@v1
if: github.event.release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ".aws-sam/build/OidcAuthorizer/bootstrap.zip"
release_id: ${{ github.event.release.id }}
- name: Upload bootstrap.zip to (new draft) GitHub release
uses: xresloader/upload-to-github-release@v1
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ".aws-sam/build/OidcAuthorizer/bootstrap.zip"
draft: true
default_release_name: "Manual release (test)"
- name: Sam publish to SAR
if: github.event.release
run: |
sam package --output-template-file .aws-sam/packaged.yml --s3-bucket ${{ secrets.SAR_ARTIFACT_BUCKET }}
sam publish --template .aws-sam/packaged.yml --region eu-west-1