-
Notifications
You must be signed in to change notification settings - Fork 6
133 lines (115 loc) · 3.56 KB
/
build-test.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: "Build Test"
on:
pull_request:
branches: [main]
paths-ignore:
- "**/README.md"
push:
branches: [main]
tags:
- "v*"
paths-ignore:
- "**/README.md"
jobs:
build-test:
if: ${{github.ref_type != 'tag'}}
name: "Build and Test"
uses: bitfinity-network/ci-wf/.github/workflows/build-n-test.yml@main
with:
runs-on: ubuntu-latest
container-image: ghcr.io/bitfinity-network/ic-dev-base:rust1.72-dfx0.15
git-fetch-depth: "0"
skip-test: false
audit-allow-warnings: true
cargo-clippy-extra-args: "-- -D warnings"
enable-target-cache: true
test-script: |
export RUST_BACKTRACE="full"
./scripts/test.sh
./scripts/build.sh
./scripts/dfx_test.sh
secrets:
gh_login: ${{ secrets.GH_PKG_LOGIN }}
gh_token: ${{ secrets.GH_PKG_TOKEN }}
release-binaries:
if: ${{github.ref_type == 'tag'}}
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: register-evm-agent
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: register-evm-agent.exe
- release_for: MacOS-x86_64
os: macos-latest
target: x86_64-apple-darwin
bin: register-evm-agent
- release_for: MacOS-M1
os: macos-latest
target: aarch64-apple-darwin
bin: register-evm-agent
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
target: ${{ matrix.platform.target }}
command: build
strip: true
args: "--release -p register_evm_agent"
- name: Prepare artifact files
run: |
mkdir -p ./target/artifact
mv target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} ./target/artifact/${{ matrix.platform.bin }}
- name: "Uploading artifact"
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
retention-days: 1
name: ${{ matrix.platform.release_for }}
path: ./target/artifact/*
publish-release:
if: ${{github.ref_type == 'tag'}}
needs: [release-binaries]
runs-on: ubuntu-latest
steps:
- name: "Artifact Linux"
uses: actions/download-artifact@v3
with:
name: Linux-x86_64
path: ./linux
- name: "Artifact MacOs"
uses: actions/download-artifact@v3
with:
name: MacOS-x86_64
path: ./macos
- name: "Artifact MacOs M1"
uses: actions/download-artifact@v3
with:
name: MacOS-M1
path: ./macos-m1
- name: "Artifact Windows"
uses: actions/download-artifact@v3
with:
name: Windows-x86_64
path: ./win
- run: |
mkdir -p .release
cd .release
mv ../linux/register-evm-agent ./register-evm-agent-nix
mv ../macos/register-evm-agent ./register-evm-agent-darwin
mv ../macos-m1/register-evm-agent ./register-evm-agent-m1
mv ../win/register-evm-agent.exe .
ls -lah .
- name: Releasing
uses: softprops/action-gh-release@v1
with:
files: |
.release/*