Skip to content

Commit 074865f

Browse files
authored
Merge pull request #79 from slayoo/dev
add artifact publishing step to GA workflow
2 parents a743429 + 78afe4e commit 074865f

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

.github/workflows/tests.yml renamed to .github/workflows/tests+artifacts.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: tests
1+
name: tests+artifacts
22

33
defaults:
44
run:
@@ -63,7 +63,39 @@ jobs:
6363

6464
- run: python -m build
6565

66+
- uses: actions/upload-artifact@v2
67+
with:
68+
name: dist
69+
path: dist
70+
6671
# - if: ${{ failure() }}
6772
# uses: mxschmitt/action-tmate@v3
6873
# with:
6974
# limit-access-to-actor: true
75+
76+
dist_check:
77+
runs-on: ubuntu-latest
78+
needs: [build]
79+
steps:
80+
- uses: actions/setup-python@v2
81+
- run: pip install twine
82+
- uses: actions/download-artifact@v2
83+
with:
84+
name: dist
85+
path: dist
86+
- run: twine check --strict dist/*
87+
88+
dist_upload:
89+
runs-on: ubuntu-latest
90+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
91+
needs: [dist_check]
92+
steps:
93+
- uses: actions/download-artifact@v2
94+
with:
95+
name: dist
96+
path: dist
97+
- uses: pypa/gh-action-pypi-publish@master
98+
with:
99+
user: __token__
100+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
101+
repository_url: https://test.pypi.org/legacy/

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import re
99
import subprocess
1010
import sys
11-
11+
from pathlib import Path
1212
from setuptools import Extension, setup
1313
from setuptools.command.build_ext import build_ext
1414

@@ -128,7 +128,8 @@ def build_extension(self, ext): # pylint: disable=too-many-branches
128128
author="Sylwester Arabas",
129129
author_email="[email protected]",
130130
description="Python interface to PartMC",
131-
long_description="",
131+
long_description=(Path(__file__).parent / "README.md").read_text(),
132+
long_description_content_type="text/markdown",
132133
ext_modules=[CMakeExtension("PyPartMC")],
133134
cmdclass={"build_ext": CMakeBuild},
134135
zip_safe=False,

0 commit comments

Comments
 (0)