-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (50 loc) · 1.52 KB
/
cd.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
name: Upload binary to S3
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
concurrency:
group: "cd"
cancel-in-progress: true
env:
PROJECT_NAME: eclair
jobs:
upload:
runs-on: ${{ matrix.runner }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: macos-amd64
runner: macos-latest
target: x86_64-apple-darwin
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: "${{ matrix.target }}"
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- name: Build Binary
run: cargo build --verbose --locked --release --target ${{ matrix.target }} --jobs 1
- name: Release Binary
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-1
AWS_EC2_METADATA_DISABLED: true
shell: bash
run: |
BIN_OUTPUT=target/${{ matrix.target }}/release/${PROJECT_NAME}
aws s3 cp $BIN_OUTPUT s3://eclair-releases/${{ matrix.name }}/${PROJECT_NAME}