-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.74 KB
/
build_artifacts.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
name: Build artifacts
on:
pull_request:
workflow_dispatch:
merge_group:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_artifacts:
name: Build artifacts
runs-on: ["self-hosted", "aws_autoscaling"]
environment: prod
steps:
- name: checkout local actions
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run formatters
run: |
./scripts/sh_format_all.sh -n -c
./scripts/nix_format_all.sh -n -c
- name: Generate required go files
run: nix develop -c make generated
- name: golangci-lint
run: nix develop -c golangci-lint run
- name: build
run: nix build -L
- name: Upload nil binary as artifact
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: nil-linux-x64
path: |
result/bin/nil
- name: upload packages to s3
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
run: |
export PATH=/home/ec2-user/.local/bin:${PATH}
nix bundle --bundler . .#nil -L
sudo yum update -y
sudo yum install -y awscli python3-pip
pip3 install -U mkrepo
aws s3 cp "deb-package-nil/`ls deb-package-nil`" s3://nil-deb-repo/ubuntu/pool/main/d/nil/
mkrepo s3://nil-deb-repo/ubuntu