This repository has been archived by the owner on May 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 2 KB
/
build-and-push.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
name: Build and save DDC SC binaries
on: [push, release]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install compatible nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-02-07
target: x86_64-unknown-linux-gnu
components: rustfmt, clippy
- name: Install dependencies
run: |
rustup target add wasm32-unknown-unknown --toolchain nightly-2023-02-07
rustup component add rust-src --toolchain nightly-2023-02-07-unknown-linux-gnu
sudo apt-get install binaryen
cargo install cargo-dylint
cargo install dylint-link
cargo install cargo-contract --version 1.5.0 --force --locked
- name: Run tests
run: |
RUSTFLAGS=-Awarnings cargo +nightly-2023-02-07 test
- name: Build contract
run: |
cargo +nightly-2023-02-07 contract build --release --manifest-path bucket/Cargo.toml
- name: Create names linked to commit
run: |
ddc_contract_name=ddc.${GITHUB_SHA:0:7}.contract
echo DDC_CONTRACT_NAME=$ddc_contract_name >> $GITHUB_ENV
ddc_wasm_name=ddc.${GITHUB_SHA:0:7}.wasm
echo DDC_WASM_NAME=$ddc_wasm_name >> $GITHUB_ENV
ddc_metadata_name=ddc.${GITHUB_SHA:0:7}.json
echo DDC_METADATA_NAME=$ddc_metadata_name >> $GITHUB_ENV
- name: Upload contract artifact
uses: actions/[email protected]
with:
name: ${{ env.DDC_CONTRACT_NAME }}
path: ./target/ink/ddc_bucket/ddc_bucket.contract
- name: Upload wasm artifact
uses: actions/[email protected]
with:
name: ${{ env.DDC_WASM_NAME }}
path: ./target/ink/ddc_bucket/ddc_bucket.wasm
- name: Upload metadata artifact
uses: actions/[email protected]
with:
name: ${{ env.DDC_METADATA_NAME }}
path: ./target/ink/ddc_bucket/metadata.json