Skip to content

Commit

Permalink
Add CD workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danhper committed Jul 13, 2024
1 parent ad3db02 commit a229bdc
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Upload binary to S3

on:
push:
branches:
- main

env:
PROJECT_NAME: eclair

jobs:
upload:
runs-on: ${{ matrix.runner }}

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

- 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.target }}/${PROJECT_NAME}

0 comments on commit a229bdc

Please sign in to comment.