Skip to content

Commit e19b8ef

Browse files
authored
chore: added contract release CI (#97)
* chore: added contract release CI * fix: same naming
1 parent 8892a49 commit e19b8ef

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
tags:
4+
- 'contract-v[0-9]+.[0-9]+.[0-9]+*'
5+
6+
workflow_dispatch:
7+
8+
name: Update Contract
9+
jobs:
10+
update-contract:
11+
runs-on: ubuntu-latest
12+
name: Update Contract
13+
permissions:
14+
contents: write
15+
steps:
16+
- name: Clone the repository
17+
uses: actions/checkout@v3
18+
19+
- name: Install cargo-near
20+
run: |
21+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
22+
23+
- name: Build NEAR contract
24+
run: |
25+
make build-migration
26+
make build
27+
timeout-minutes: 60
28+
29+
- name: Archive built WASM files
30+
run: |
31+
mkdir -p artifacts
32+
find ./bin -name "*.wasm" -exec cp {} artifacts/ \;
33+
zip -j contract.zip artifacts/*
34+
shell: bash
35+
36+
- name: Create Release
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
tag_name: ${{ github.ref_name }}
40+
files: contract.zip

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
22

3-
OUT_DIR ?= $(MAKEFILE_DIR)/res
43
MANIFEST := $(MAKEFILE_DIR)/eth-connector/Cargo.toml
54

65
build-migration:
76
cargo near build non-reproducible-wasm --manifest-path $(MANIFEST) --out-dir $(MAKEFILE_DIR)/bin --features migration
8-
mv $(MAKEFILE_DIR)/bin/aurora_eth_connector.wasm $(OUT_DIR)/aurora_eth_connector_migration.wasm
7+
mv $(MAKEFILE_DIR)/bin/aurora_eth_connector.wasm $(MAKEFILE_DIR)/bin/aurora_eth_connector_migration.wasm
98

109
build:
11-
cargo near build reproducible-wasm --manifest-path $(MANIFEST) --out-dir $(OUT_DIR)
10+
cargo near build reproducible-wasm --manifest-path $(MANIFEST) --out-dir $(MAKEFILE_DIR)/bin
1211

1312
test:
1413
cargo test

0 commit comments

Comments
 (0)