-
Notifications
You must be signed in to change notification settings - Fork 7
97 lines (95 loc) · 2.94 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and publish
on:
pull_request:
types: [closed]
branches:
- master
- develop
- beta
- stable
jobs:
create_release:
if: github.event.pull_request.merged
name: Create release
runs-on: ubuntu-18.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.export_outputs.outputs.version }}
branch: ${{ steps.export_outputs.outputs.branch }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init
- name: Install ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install python-setuptools
- name: Set Versions
run: |
bash ./scripts/set_versions_ga.sh
- name: Set release
run: |
if [[ "$BRANCH" == "stable" ]]; then
export PRERELEASE=false
else
export PRERELEASE=true
fi
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
- 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: Export outputs
id: export_outputs
run: |
echo "::set-output name=version::$VERSION"
echo "::set-output name=branch::$BRANCH"
build_and_publish:
if: github.event.pull_request.merged
needs: create_release
name: Build and publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
asset_name: skale-${{ needs.create_release.outputs.version }}-Linux-x86_64
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install ubuntu dependencies
if: matrix.os == 'ubuntu-18.04'
run: |
sudo apt-get update
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e .[dev]
pip install wheel
pip install --upgrade 'setuptools<45.0.0'
- name: Checkout submodules
run: git submodule update --init
- name: Build library
run: |
bash ./scripts/build.sh ${{ needs.create_release.outputs.version }} ${{ needs.create_release.outputs.branch }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./dist/${{ matrix.asset_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream