diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..2ad3292 --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,25 @@ +name: Check Code Quality + +on: pull_request + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: psf/black@stable + with: + options: --check . + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Run flake8 + uses: julianwachholz/flake8-action@v2 + with: + checkName: "Python Lint" + path: ./relik + plugins: "pep8-naming==0.13.3 flake8-comprehensions==3.14.0" + config: .flake8 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/python-publish-pypi.yml b/.github/workflows/python-publish-pypi.yml new file mode 100644 index 0000000..268ac79 --- /dev/null +++ b/.github/workflows/python-publish-pypi.yml @@ -0,0 +1,33 @@ +name: Upload Python Package to PyPi + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + + - name: Extract version + run: echo "GOLDENRETRIEVER_VERSION=`python setup.py --version`" >> $GITHUB_ENV + + - name: Build package + run: python -m build + + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/goldenretriever/version.py b/goldenretriever/version.py index eb5b3ce..15f40e7 100644 --- a/goldenretriever/version.py +++ b/goldenretriever/version.py @@ -7,7 +7,7 @@ _PATCH = "0" # This is mainly for nightly builds which have the suffix ".dev$DATE". See # https://semver.org/#is-v123-a-semantic-version for the semantics. -_SUFFIX = os.environ.get("goldenretriever_VERSION_SUFFIX", "") +_SUFFIX = os.environ.get("GOLDENRETRIEVER_VERSION_SUFFIX", "") VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR) VERSION = "{0}.{1}.{2}{3}".format(_MAJOR, _MINOR, _PATCH, _SUFFIX)