Skip to content

Commit

Permalink
Use github actions for release and pypi publishing (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuessWhoSamFoo committed Mar 16, 2023
1 parent c4d4f68 commit 9c04c13
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 71 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ci
on: push

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Run Unit Test
run: |
cd python
tox -e unit
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Run Link
run: |
cd python
tox -e format
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Setup Go Environment
uses: actions/setup-go@v3
with:
go-version: '>=1.20.0'
- name: Upload
run: |
mkdir -p build/
cd python && python setup.py sdist
go get github.com/tcnksm/ghr
ghr -r ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} -replace -draft ${{ TAG_NAME }} build/
pypi:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Publish
env:
TWINE_USERNAME: vaporio
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
cd python
tox -e publish
67 changes: 0 additions & 67 deletions .jenkins

This file was deleted.

1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.10
3 changes: 1 addition & 2 deletions python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exclude = lib/,src/,docs/,bin/,.tox/,synse_pb2*.py
ignore = F401,F403

[isort]
not_skip = __init__.py
default_section = THIRDPARTY
known_first_party = synse_grpc,tests
skip = synse_pb2.py,synse_pb2_grpc.py
skip = synse_pb2.py,synse_pb2_grpc.py
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
zip_safe=False,
install_requires=[
'grpcio>=1.8.6',
'protobuf',
'protobuf>=3.20.3, <4',
],
classifiers=[
'Intended Audience :: Developers',
Expand Down
2 changes: 1 addition & 1 deletion python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ deps =
isort
flake8
commands =
isort {posargs:synse_grpc tests} -rc -c --diff
isort {posargs:synse_grpc tests} -c --diff
flake8 --show-source --statistics {posargs:synse_grpc tests}

[testenv:publish]
Expand Down

0 comments on commit 9c04c13

Please sign in to comment.