-
-
Notifications
You must be signed in to change notification settings - Fork 13
61 lines (54 loc) · 1.88 KB
/
pypi_upload.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
name: Create Release & Upload To PyPI
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- v?[0-9]+.[0-9]+.[0-9]+ # add .* to allow dev releases
jobs:
build:
name: vistir PyPI Upload
runs-on: ubuntu-latest
env:
CI: "1"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install latest tools for build
run: |
python -m pip install --upgrade pip setuptools wheel pipenv invoke
python -m pipenv install --dev --pre
python -m pipenv run pip install invoke
- name: Build wheels
run: |
python -m pipenv run inv build
- name: Upload to PyPI via Twine
# to upload to test pypi, pass --repository-url https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
run: |
python -m pipenv run twine upload --verbose -u '__token__' -p '${{ secrets.PYPI_TOKEN }}' dist/*
# git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:master
# we need to use a deploy key for this to get around branch protection as the default token fails
- name: Pre-bump
run: |
git config --local user.name 'Github Action'
git config --local user.email [email protected]
python -m pipenv run inv bump-version -t dev
git commit -am 'pre-bump'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master