-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (108 loc) · 3.49 KB
/
build-lambda.yml
File metadata and controls
120 lines (108 loc) · 3.49 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build Boot Fargate Lambda for ARM64
on:
push:
branches: [main,build]
pull_request:
jobs:
build-lambda:
name: Build Boot Fargate Lambda for ARM64
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- name: Checkout code for ARM64 build
uses: actions/checkout@v4
- name: Install Rust toolchain with Cargo Lambda
uses: moonrepo/setup-rust@v1
with:
bins: cargo-lambda
targets: aarch64-unknown-linux-gnu
- name: Install Zig toolchain
uses: mlugg/setup-zig@v1
with:
version: 0.14.0
- name: Install cargo-lambda
run: cargo install cargo-lambda --locked
- name: Build Lambda for ARM64
working-directory: boot-fargate-lambda
run: |
cargo lambda build --release --arm64
- name: Upload Boot Fargate Lambda artifact
uses: actions/upload-artifact@v4
with:
name: boot_fargate_lambda
path: boot-fargate-lambda/target/lambda/boot-fargate-lambda/bootstrap
node-ci-test:
name: Runs Node.js tests
runs-on: ubuntu-latest
needs: build-lambda
steps:
- uses: actions/checkout@v4
- name: Set up Node.js for NPM
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Debug workspace contents
run: ls -R ${{github.workspace}}
- name: Package
run: npm run package
publish-npm:
name: Publish on NPM
runs-on: ubuntu-latest
environment: npm
needs: node-ci-test
permissions:
id-token: write
steps:
- name: Checkout zeroscaler-cdk
uses: actions/checkout@v4
- name: Download Artifact for lambda build
uses: actions/download-artifact@v4
with:
name: boot_fargate_lambda
- name: Set up Node.js for NPM
uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: npm install
- name: Package jsii
run: npm run package
- name: Debug workspace contents
run: ls -R ${{github.workspace}}
- name: Setup GitHub deploy key
env:
GITHUB_DEPLOY_KEY: ${{ secrets.GO_DEPLOY_KEY }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: ssh-agent -a ${SSH_AUTH_SOCK} && ssh-add - <<< "${GITHUB_DEPLOY_KEY}"
- if: github.ref == 'refs/heads/main' || true
name: Publish to NPM
run: npx publib
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSPHRASE }}
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
MAVEN_SERVER_ID: central-ossrh
MAVEN_VERBOSE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
GIT_USER_NAME: github-actions
GIT_USER_EMAIL: github-actions@github.com
GIT_USE_SSH: "true"
GIT_BRANCH: release
SSH_AUTH_SOCK: /tmp/ssh_agent.sock