forked from chirpstack/chirpstack-concentratord
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (80 loc) · 2.14 KB
/
main.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
name: CI
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.11
-
name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
-
name: Run tests
run: nix-shell --command "make test"
dist:
needs: tests
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
target:
- aarch64-unknown-linux-musl
- armv5te-unknown-linux-musleabi
- armv7-unknown-linux-musleabihf
- x86_64-unknown-linux-musl
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.11
-
name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-dist-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
-
name: Build distributables
run: nix-shell --command "make dist-${{ matrix.target }}"
-
name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
-
name: Upload binaries to S3
run: |
aws s3 sync dist s3://builds.loraserver.io/chirpstack-concentratord
if: startsWith(github.ref, 'refs/tags/v')