-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.9 KB
/
dev-build-to-pypi.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
name: Dev build and publish Python distributions to PyPI
on:
push:
branches:
- dev_*
- pypi_*
- story_*
jobs:
build-n-publish:
name: Dev build and publish Python distributions to PyPI
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Wait for tests to succeed
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
running-workflow-name: 'Dev build and publish Python distributions to PyPI'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
allowed-conclusions: success
# Prepare custom build version
- name: Get package version
id: pack_ver
uses: notiz-dev/github-action-json-property@release
with:
path: package_info.json
prop_path: package_version
- name: Build custom package version
id: release_ver
run: echo ::set-output name=value::"${{ steps.pack_ver.outputs.prop }}.dev${{ github.run_id }}"
- name: Show package version
run: echo ${{ steps.release_ver.outputs.value }}
- name: Set version for current build in package_info.json
uses: MerthinTechnologies/edit-json-action@v1
with:
filename: './package_info.json'
key: 'package_version'
value: ${{ steps.release_ver.outputs.value }}
# Build and publish
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build package
run: |
python setup.py sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
repository_url: https://upload.pypi.org/legacy/