diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 430232ef..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,138 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2 -jobs: - build: - parallelism: 1 - environment: - TEST_INHOUSE: false - - docker: - # specify the version you desire here - # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.6 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "requirements.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -U pip - pip install -U -r requirements.txt - pip install codecov - - - save_cache: - paths: - - ./venv - key: v1-dependencies-{{ checksum "requirements.txt" }} - - - run: - name: install test dependencies - command: | - . venv/bin/activate - pip install -r requirements-test.txt - - # run tests! - - run: - name: run tests - command: | - . venv/bin/activate - mkdir test-results - sudo apt-get -y install git-lfs - git lfs pull - py.test --junitxml=test-results/junit.xml --verbose - - - - store_test_results: - path: test-results - destination: tr2 - - - store_artifacts: - path: test-results - destination: tr1 - - - deploy_pypi: - docker: - - image: circleci/python:3.6 - working_directory: ~/repo - - steps: - - checkout - - - run: - name: configure pypirc - command: | - echo -e "[pypi]" >> ~/.pypirc - echo -e "username = $PYPI_USERNAME" >> ~/.pypirc - echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc - - - run: - name: setup_venv - command: | - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip - pip install -U cryptography - pip install -U twine setuptools wheel - - - run: - name: check_version - command: | - echo "CIRCLE_TAG: $CIRCLE_TAG" - . venv/bin/activate - python setup.py check_version -e $CIRCLE_TAG - - - run: - name: build wheels - command: | - . venv/bin/activate - python setup.py sdist - python setup.py bdist_wheel - - - run: - name: deploy - command: | - . venv/bin/activate - twine upload dist/* --verbose --config-file ~/.pypirc - -workflows: - version: 2 - build_and_deploy: - jobs: - - build: - filters: - tags: - only: /^v\d+(\.\d+)*(\.[0-9A-Za-z]*)*/ - branches: - ignore: /.*/ - - deploy_pypi: - requires: - - build - filters: - tags: - only: /^v\d+(\.\d+)*(\.[0-9A-Za-z]*)*/ - branches: - ignore: /.*/ - run_tests: - jobs: - - build diff --git a/.github/workflows/deploy_release.yml b/.github/workflows/deploy_release.yml new file mode 100644 index 00000000..f6238f21 --- /dev/null +++ b/.github/workflows/deploy_release.yml @@ -0,0 +1,56 @@ +name: Deploy release +on: + push: + tags: + - '^v\d+(\.\d+)*(\.[0-9A-Za-z]*)*' + +jobs: + common-actions: + name: Run PR Workflow + uses: ./.github/workflows/github-actions-ci.yml + secrets: inherit + + deploy-release: + needs: + - common-actions + name: Deploy release from tag + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + # this should be the lowest supported version + python-version: '3.10' + + - name: Install build dependencies + run: | + pip install --upgrade pip + pip install hatch + pip list + + - name: Build wheel and source distribution + run: | + hatch build + ls -1 dist + + - name: Upload wheel and source distributions to PyPI + run: | + pip install twine + ls -1 dist + # our current token does not work on testpypi + # twine upload -r testpypi -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/* + twine upload -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/* + + - name: Keep packages + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: pypi-wheel-and-sdist + path: | + dist/* + if-no-files-found: error diff --git a/.github/workflows/github-actions-ci.yml b/.github/workflows/github-actions-ci.yml index e533a1b4..87d52254 100644 --- a/.github/workflows/github-actions-ci.yml +++ b/.github/workflows/github-actions-ci.yml @@ -1,12 +1,15 @@ name: ci/github-actions on: + workflow_call: pull_request: - branches: [ master, feature/** ] - + branches: + - master push: - branches: [ master, feature/** ] - + branches: + - master + tags_ignore: + - '*' jobs: run-light-tests: