Skip to content

Commit

Permalink
Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccorl committed Feb 7, 2024
1 parent 118b604 commit b064d8e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
33 changes: 33 additions & 0 deletions .github/workflows/python-publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion goldenretriever/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit b064d8e

Please sign in to comment.