-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (48 loc) · 1.5 KB
/
Copy pathrust-build.yml
File metadata and controls
59 lines (48 loc) · 1.5 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
name: Build Node Daemon
on:
push:
branches: [main]
paths:
- crates/sandchest-node/**
- packages/contract/proto/**
- Cargo.toml
- Cargo.lock
workflow_dispatch:
permissions:
id-token: write
contents: read
env:
AWS_REGION: us-east-1
CARGO_TERM_COLOR: always
jobs:
build:
name: Build sandchest-node
runs-on: ubuntu-latest
timeout-minutes: 20
environment: production
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Build release binary
run: cargo build --release --package sandchest-node
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: sandchest-node
path: target/release/sandchest-node
retention-days: 30
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Upload binary to S3
run: |
aws s3 cp target/release/sandchest-node \
"s3://${{ vars.ARTIFACT_BUCKET }}/binaries/sandchest-node/${{ github.sha }}/sandchest-node"
aws s3 cp target/release/sandchest-node \
"s3://${{ vars.ARTIFACT_BUCKET }}/binaries/sandchest-node/latest/sandchest-node"