-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.42 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
name: Build and publish
on:
pull_request:
types: [closed]
branches:
- main
- develop
- beta
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged
strategy:
matrix:
python-version: [3.11]
env:
PIP_USERNAME: ${{ secrets.PIP_USERNAME }}
PIP_PASSWORD: ${{ secrets.PIP_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -e .[dev]
pip install wheel
- name: Build library
run: |
export BRANCH=${GITHUB_REF##*/}
echo "Branch $BRANCH"
export VERSION=$(bash ./scripts/calculate_version.sh)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version $VERSION"
bash ./scripts/build.sh
- name: Publish to pip
run: |
bash ./scripts/publish.sh
- name: Checkout code
uses: actions/checkout@master
- 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: true