Skip to content

Commit 24c496b

Browse files
Merge pull request #84 from ioannistsanaktsidis/publish
gh-actions: publish to pypi
2 parents bb433eb + c509d03 commit 24c496b

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

.github/workflows/build-and-release-py2.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: test (python 2.7)
22

33
on:
4+
push:
5+
branches: [master]
46
pull_request:
57
branches: [master]
68

.github/workflows/build-and-release.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test and bump
1+
name: test, bump and publish
22

33
on:
44
push:
@@ -78,4 +78,42 @@ jobs:
7878
run: |
7979
sha_new=$(git rev-parse HEAD)
8080
echo $sha_new
81-
echo "::set-output name=SHA::$sha_new"
81+
echo "::set-output name=SHA::$sha_new"
82+
83+
publish:
84+
needs: bump
85+
if: ${{ github.event_name == 'push' }}
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0
92+
ref: ${{ needs.bump.outputs.new_sha }}
93+
94+
- name: Set up Python
95+
uses: actions/setup-python@v5
96+
with:
97+
python-version: '3.11'
98+
99+
- name: Install python dependencies
100+
run: |
101+
python -m pip install --upgrade pip
102+
pip install setuptools twine wheel coveralls
103+
pip install -e .[all]
104+
105+
- name: Show python dependencies
106+
run: |
107+
pip freeze
108+
109+
- name: Build package
110+
run: |
111+
mkdir clean-build
112+
python setup.py sdist bdist_wheel --universal --dist-dir ./clean-build
113+
114+
- name: Publish package
115+
uses: pypa/gh-action-pypi-publish@v1.3.1
116+
with:
117+
user: __token__
118+
password: ${{ secrets.pypi_token }}
119+
packages_dir: clean-build/

0 commit comments

Comments
 (0)