-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (75 loc) · 2.31 KB
/
publish.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
name: Publish
on:
pull_request:
types: [closed]
branches:
- stable
- develop
- beta
jobs:
predeployed:
runs-on: ubuntu-latest
env:
PIP_USERNAME: ${{ secrets.PIP_USERNAME }}
PIP_PASSWORD: ${{ secrets.PIP_PASSWORD }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14.x'
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
npm i
cd predeployed/
pip install wheel
pip install -e .[dev]
- name: Compile with truffle
run: |
npm run compile
- name: Calculate versions
run: |
export BRANCH=${GITHUB_REF##*/}
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
echo "Branch $BRANCH"
export VERSION=$(bash ./scripts/calculate_version.sh)
echo "VERSION=$VERSION" >> $GITHUB_ENV
( test $BRANCH = "stable" || test $BRANCH = "master" && export PRERELEASE=false ) || export PRERELEASE=true
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
- name: Build
working-directory: ./predeployed
run: |
export PIP_VERSION=$(bash ./scripts/calculate_version.sh)
echo "Pkg version $PIP_VERSION"
VERSION=$PIP_VERSION bash ./scripts/build.sh
- name: Publish to pip
working-directory: ./predeployed
run: |
bash ./scripts/publish.sh
- name: Generate ABI
env:
VERSION: ${{ env.VERSION }}
run: |
mkdir data
pip install predeployed/dist/*.whl
./predeployed/scripts/generate_abi.py > data/config-controller-$VERSION-abi.json
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: ${{ env.PRERELEASE }}
- name: Upload ABI
id: upload-abi
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: data/*.json