Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint and Test

on:
pull_request:
branches: [master]
push:
branches: [master]

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: install ALL dependencies
run: |
pip install -U -r requirements-dev.txt
pip install -U -r requirements.txt
pip install .
- name: run pre-commit linters and formatters
uses: pre-commit/action@v2.0.3
- name: run pytest tests
run: python -m pytest --import-mode=append tests/ --cov

83 changes: 83 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# setup tools guide used as base template - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# wait on check action used to wait for tests to finish - https://github.com/marketplace/actions/wait-on-check
name: Release

on:
push:
tags:
- 'v*'

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest

steps:
- name: Wait for lint and tests to succeed
uses: lewagon/wait-on-check-action@v0.2
with:
ref: ${{ github.ref }}
check-name: 'lint-test'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Checkout Code
uses: actions/checkout@master

- name: Validate tag version - compare version.txt to tag
run: |
version=$(cat ./version.txt)
tag=${GITHUB_REF/refs\/tags\//}
tag="${tag:1}" # remove the 'v' prefix from the tag that triggered this action
echo $version
echo $tag
if [ "$tag" == "$version" ]
then
echo "Tag and version are equal"
else
echo "Error: Tag and version are not equal, cannot create a release"
exit 1
fi

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install pypa/build
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish distribution 📦 to Test PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true # skip duplicate uploads to test pypi

- name: Publish distribution 📦 to Real PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}


- name: Create Github Release and Upload Artifacts
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
requests>=2,<3
abstract-http-client
abstract-http-client>=1,<2
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
name = cloudshell_sandboxapi_wrapper
name = cloudshell-sandbox-rest
version = file: version.txt
author = QualiLab
author_email = support@qualisystems.com
Expand All @@ -20,8 +20,10 @@ package_dir =
= src
packages = find:
python_requires = >=3.7
install_requires =
requests>=2
install_requires =[
requests>=2, <3
abstract-http-client>=1,<2
]

[options.packages.find]
where = src
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
0.1.0