Skip to content

Commit

Permalink
Updated Github CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Apr 13, 2024
1 parent f2d69ba commit 2da58a1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publishing

on: [push]

jobs:
test:
uses: ./.github/workflows/test.yml
publish:
name: Publish the client to the public registry
needs: [test]
runs-on: ubuntu-latest
env:
PYPIRC: ${{ secrets.PYPIRC }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Use Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Check for dev-version
if: ${{ contains(github.ref, 'master') }}
run: |
VERSION=`git log -1 --date=format:"%y%m%d%H" --format=%cd|head`
echo "version $VERSION"
sed -i -E "s/(VERSION = \")([0-9]\.[0-9]\.)(.*)(\")/\1\2$VERSION\4/1" setup.py
- name: Publish
run: |
echo $PYPIRC > ~/.pypirc
python -m pip install --user --upgrade wheel
python -m pip install --user --upgrade twine
python setup.py sdist bdist_wheel
python -m twine upload dist/* -u __token__ -p $PYPI_TOKEN
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Testing

on: [push]
on: [workflow_call]

jobs:
test:
Expand Down

0 comments on commit 2da58a1

Please sign in to comment.