From a000313eb46793742c99b213bcf862dd8f01c7d0 Mon Sep 17 00:00:00 2001 From: Emmanuel Mathot Date: Wed, 22 Nov 2023 12:24:46 +0100 Subject: [PATCH] simplified --- .circleci/config.yml | 85 --------------------------- .github/workflows/build.yaml | 7 --- .github/workflows/package.yaml | 25 ++++++++ .github/workflows/python_publish.yaml | 45 -------------- 4 files changed, 25 insertions(+), 137 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/python_publish.yaml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index f17566d..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,85 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/python:3.10 - working_directory: ~/calrissian - steps: - - checkout - - restore_cache: - key: v1-dependency-cache-{{ checksum "requirements.txt" }} - - run: - name: install python dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r requirements.txt - pip install nose2 - - save_cache: - key: v1-dependency-cache-{{ checksum "requirements.txt" }} - paths: - - "venv" - - run: - name: run tests - command: | - . venv/bin/activate - nose2 - environment: - RETRY_ATTEMPTS: 1 - deploy: - docker: - - image: circleci/python:3.10 - steps: - - checkout - - restore_cache: - key: v1-setup-cache-{{ checksum "setup.py" }} - - run: - name: install python dependencies - command: | - python3 -m venv venv - . venv/bin/activate - python setup.py install - pip install twine - pip install wheel - - save_cache: - key: v1-setup-cache-{{ checksum "setup.py" }} - paths: - - "venv" - - run: - name: verify git tag vs. version - command: | - python3 -m venv venv - . venv/bin/activate - python setup.py verify - - run: - name: create packages - command: | - . venv/bin/activate - python setup.py bdist_wheel --universal - - run: - name: init .pypirc - command: | - echo -e "[pypi]" >> ~/.pypirc - echo -e "username = $PYPI_USER" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - - run: - name: upload to pypi - command: | - . venv/bin/activate - twine upload dist/* -workflows: - version: 2 - build_and_deploy: - jobs: - - build: - filters: - tags: - only: /.*/ - - deploy: - requires: - - build - filters: - tags: - only: /[0-9]+(\.[0-9]+)*/ - branches: - ignore: /.*/ diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0234d42..6656f6b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -31,10 +31,3 @@ jobs: . venv/bin/activate pip install nose2 nose2 - - name: Build a binary wheel and a source tarball - run: python3 -m build - - name: Store the distribution packages - uses: actions/upload-artifact@v3 - with: - name: python-package-distributions - path: dist/ diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 767ee59..ead97de 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -8,6 +8,31 @@ on: jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python3 -m venv venv + . venv/bin/activate + pip install setuptools wheel twine + pip install -r requirements.txt + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USER }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py bdist_wheel --universal + twine upload dist/* + version: runs-on: ubuntu-latest outputs: diff --git a/.github/workflows/python_publish.yaml b/.github/workflows/python_publish.yaml deleted file mode 100644 index e6deb3a..0000000 --- a/.github/workflows/python_publish.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Upload Python Package - -on: - push: - branches: - - issue-160 - -jobs: - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - python-version: '3.10' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python3 -m venv venv - . venv/bin/activate - pip install setuptools wheel twine - pip install -r requirements.txt - - name: run tests - env: - RETRY_ATTEMPTS: 1 - run: | - python -m pip install --upgrade pip - python3 -m venv venv - . venv/bin/activate - pip install -r requirements.txt - pip install nose2 - nose2 - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USER }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - - run: | - python setup.py bdist_wheel --universal - twine upload dist/* \ No newline at end of file