From e7fb53573af4a8a5534656b751671f14dfa57f1b Mon Sep 17 00:00:00 2001 From: Filipe Pina <636320+fopina@users.noreply.github.com> Date: Mon, 20 Nov 2023 11:03:09 +0000 Subject: [PATCH 1/3] github workflows to replace travis (#52) --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++ .github/workflows/publish_test.yml | 37 ++++++++++++++++++++++++++ .github/workflows/tests.yml | 42 ++++++++++++++++++++++++++++++ .travis.yml | 24 ----------------- test-requirements.txt | 4 +-- 5 files changed, 115 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/publish_test.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fd3abd4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: publish + +on: + release: + types: [created] + +jobs: + tests: + uses: ./.github/workflows/tests.yml + publish: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/publish_test.yml b/.github/workflows/publish_test.yml new file mode 100644 index 0000000..3d6b7e3 --- /dev/null +++ b/.github/workflows/publish_test.yml @@ -0,0 +1,37 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: publish test + +on: + push: + branches: + - testpypi + - testpypi-* + - testpypi/* + +jobs: + tests: + uses: ./.github/workflows/tests.yml + publish_test: + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload --repository testpypi dist/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..81068d2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: tests + +on: + pull_request: + branches: + - develop + + workflow_call: + +jobs: +# TODO: https://github.com/devopshq/teamcity/issues/3 - comment carried over from .travis.yml +# style: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# - name: Set up Python +# uses: actions/setup-python@v4 +# with: +# python-version: '3.x' + +# - name: requirements +# run: pip install -r test-requirements.txt + +# - name: run checker +# run: flake8 + + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: requirements + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + + - name: run tests + run: pytest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 87b0fee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -python: - - "3.4" - - "3.6" - -install: - - pip install -r requirements.txt - - pip install -r test-requirements.txt - -script: - - set -e - - pytest -# - flake8 # TODO: https://github.com/devopshq/teamcity/issues/3 - -deploy: - provider: pypi - user: devopshq - password: - secure: YpVKSjUXtBcERUZUEo+S6nrzeAmWW4A66hQi+mZzX9plz0vBitK0052GnciKtcBpyZ16sx/u7ADwreEHgkZp+p0pos1l9Yombqagbr+twX6FfWrHc+65PWjS9ZiZadOswP7+LCwd248wYyInyMB4m7CYxElkcs5PDvgfFI5J66chDf2vu252PGDYHS6t8P3nWErxlWXIwRjQKq0jlh7w1Sz/anw0IgRd3FBIugPlXRjGzXGoxHK5yH5Sbg6Q3fLPYdGdTOu33C32lATuhaG6SqOqaOjFrvIVSclRX3dxDzbiVpm8pDfa7BIn3KdL2wKZn6b8qrAGSUTMyla3vUN+6f4ro8TpHtc2157WS7XrMo+nhqrePgzmn3/2AcuDDl+rpNIPXKrzV8cLEdS52gytTLdkBCMqv+BIEJqh7oa+lDVhzM+ShtSly1DTHzKsN+/VStGEK7vMkQDtXw4wlVV5t6UdEUmd0A1mZ4HHWthO3ORPc/1EszXBKJIr1gHhLl/WhNMu6C+dIPlTq5zQA50xf/V5vIRuqiw5f9y+d1Xmzop0ZYgwXDVnoAoKpLwFhxfeBiYD1BQ6M6BUIsQiUWDQ038i+NPyFBpp4epOwF8rA0DLg1dx011ZOAFZqvx0fp/FRsfoJ0VjEAZpdZqt3NjudGwzZ+ZSVAuQzWnzOxpy2as= - distributions: sdist bdist_wheel - skip_cleanup: false - on: - branch: master - python: '3.6' diff --git a/test-requirements.txt b/test-requirements.txt index 2702246..5990b0a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ -coverage>=4.0.3 -nose>=1.3.7 +pytest-cov>=4,<5 +pytest>=7,<8 pluggy>=0.3.1 py>=1.4.31 randomize>=0.13 From 02e8ca94658e1cc7c740ae268980d612fed21d6e Mon Sep 17 00:00:00 2001 From: Aleksey Date: Mon, 20 Nov 2023 18:06:39 +0700 Subject: [PATCH 2/3] Bump to 1.0.9 --- dohq_teamcity/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dohq_teamcity/version.py b/dohq_teamcity/version.py index e13bd59..39e0411 100644 --- a/dohq_teamcity/version.py +++ b/dohq_teamcity/version.py @@ -1 +1 @@ -__version__ = "1.0.8" +__version__ = "1.0.9" From 8a08fcdee46fba32c5fae7fcd84942985d70f761 Mon Sep 17 00:00:00 2001 From: Aleksey Date: Mon, 20 Nov 2023 18:07:59 +0700 Subject: [PATCH 3/3] Add how to release section --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index adb8af7..50529d9 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,8 @@ bt = bt.read() ## What next? See more examples and full documantation on page: https://devopshq.github.io/teamcity + +## How to release? +1. Bump version in `dohq_teamcity/version.py` +2. Merge changes to **master** branch +3. Create Github Release