-
Notifications
You must be signed in to change notification settings - Fork 19
54 lines (52 loc) · 1.78 KB
/
contracts.test+publish.yaml
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: "contracts: test+publish"
on:
workflow_dispatch:
push:
branches-ignore:
- "master"
paths:
- "contracts/v0.1/**"
- "contracts/v0.2/**"
- "!contracts/v0.1/**/VRFCoordinator.sol"
- "!contracts/v0.1/**/VRFConsumerBase.sol"
- "!contracts/v0.1/**/vrf/**"
- "!contracts/v0.2/analysis/**"
- "!contracts/v0.2/lib/**"
- "!contracts/v0.2/script/**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: "20.10.0"
registry-url: "https://registry.npmjs.org"
scope: "@bisonai"
always-auth: true
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- run: yarn contracts install
- run: yarn contracts prettier-solidity-check
- run: yarn contracts solhint
- run: yarn contracts lint
- run: yarn contracts clean && yarn contracts build
- run: yarn contracts test-non-vrf
env:
L2_PROVIDER: ${{ secrets.L2_PROVIDER }}
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: packageJsonVersion
with:
cmd: "jq .version ./contracts/package.json -r"
- name: Extract version from the latest published package
id: npmPackageVersion
run: echo "VERSION=`npm view @bisonai/orakl-contracts version`" >> $GITHUB_OUTPUT
- name: Publish package
if: steps.packageJsonVersion.outputs.value != steps.npmPackageVersion.outputs.VERSION
run: yarn contracts publish --new-version ${{ steps.packageJsonVersion.outputs.value }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}