Skip to content

Commit e33c208

Browse files
authored
Merge pull request #104 from ssl-hep:gordonwatts/issue102
Push to PyPI when a release is tagged in github
2 parents 61727c4 + 301c979 commit e33c208

File tree

5 files changed

+43
-9
lines changed

5 files changed

+43
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install dependencies
26+
env:
27+
servicex_version: 1.0a1
2628
run: |
2729
python -m pip install --upgrade pip setuptools wheel
2830
pip install --no-cache-dir -e .[test]

.github/workflows/pypi.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Push to PyPI
2+
3+
on:
4+
release:
5+
types: [released, prereleased]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.7
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip build
20+
- name: Build the servicex wheel
21+
env:
22+
servicex_version: ${{ github.ref }}
23+
run: |
24+
python -m build --sdist --wheel
25+
- name: Publish servicex to PyPI
26+
uses: pypa/gh-action-pypi-publish@v1.3.1
27+
with:
28+
user: __token__
29+
password: ${{ secrets.pypi_password_servicex }}

.vscode/push-to-pypi.ps1

Lines changed: 0 additions & 8 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"dont",
3232
"fget",
3333
"fname",
34+
"getenv",
3435
"gitlab",
3536
"inmem",
3637
"jupyter",
@@ -48,13 +49,17 @@
4849
"numpy",
4950
"pathlib",
5051
"pnfs",
52+
"prereleased",
5153
"protomolecule",
5254
"ptetaphi",
55+
"pypa",
56+
"pypi",
5357
"pytest",
5458
"qastle",
5559
"qsize",
5660
"rootfiles",
5761
"rucio",
62+
"sdist",
5863
"secretkey",
5964
"servicex",
6065
"servicexabc",

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from setuptools import find_packages # noqa: F401
33
from distutils.core import setup
44
import sys
5+
import os
56

67
# Use the readme as the long description.
78
with open("README.md", "r") as fh:
@@ -14,8 +15,13 @@
1415
if sys.version_info[1] < 8:
1516
extra_test_packages.append('asyncmock')
1617

18+
version = os.getenv('servicex_version')
19+
if version is None:
20+
raise Exception('servicex_version env var is not set')
21+
version = version.split('/')[-1]
22+
1723
setup(name="servicex",
18-
version='2.0.0',
24+
version=version,
1925
packages=['servicex'],
2026
scripts=[],
2127
description="Front-end for the ServiceX Data Server",

0 commit comments

Comments
 (0)