-
Notifications
You must be signed in to change notification settings - Fork 13
87 lines (72 loc) · 2.06 KB
/
bump-and-publish.yml
File metadata and controls
87 lines (72 loc) · 2.06 KB
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
name: bump and publish
on:
workflow_call:
jobs:
bump:
runs-on: ubuntu-latest
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install bump2version
shell: bash
run: |
python -m pip install --upgrade pip
pip install bump2version
- name: Configure git
shell: bash
run: |
git config user.name github-actions
git config user.email "38065702145+github-actions[bot]@users.noreply.github.com"
- name: Bump version
shell: bash
run: |
bump2version patch --tag --verbose
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: get sha
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "SHA=$sha_new" >> $GITHUB_OUTPUT
publish:
needs: bump
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.bump.outputs.new_sha }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools twine wheel coveralls
pip install -e .[all]
- name: Show python dependencies
run: |
pip freeze
- name: Build package
run: |
mkdir clean-build
python setup.py sdist bdist_wheel --universal --dist-dir ./clean-build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.3.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: clean-build/