Skip to content

Commit

Permalink
Add GitHub Actions. (#698)
Browse files Browse the repository at this point in the history
* Add GitHub Actions.

* Fix path.

* Remove minimal configuration (no optional dependencies).

* Disable Windows CI.

* Update codecov action.

* Ignore coverage of templates.

* Remove CircleCI.

* Update changelog.

* Update changelog.
  • Loading branch information
bdice authored Jan 17, 2023
1 parent 7e36f5c commit d543982
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 271 deletions.
229 changes: 0 additions & 229 deletions .circleci/config.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .circleci/deploy.bash

This file was deleted.

File renamed without changes.
18 changes: 18 additions & 0 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish to PyPI

on:
push:
tags:
- 'v*.*.*'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
build-and-test-sdist-and-wheels:
uses: ./.github/workflows/publish-packages.yml
with:
upload_to_test: false
secrets:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/deploy-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish to TestPyPI

on:
push:
branches:
- 'release/*.*.*'

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
build-and-test-sdist-and-wheels:
uses: ./.github/workflows/publish-packages.yml
with:
upload_to_test: true
secrets:
TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
72 changes: 72 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish packages

on:
workflow_call:
inputs:
upload_to_test:
required: true
type: boolean
secrets:
TEST_PYPI_API_TOKEN:
required: false
PYPI_API_TOKEN:
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
# We must explicitly install the requirements so that we can force
# installation of the local wheel below in case the version conflicts
# with published wheels (typically only possible during testing).
python -m pip install \
-r requirements.txt \
-r requirements-test.txt
- name: Install pypa/build
run:
python -m pip install build
- name: Build a binary wheel and a source tarball
run:
python -m build --sdist --wheel --outdir dist/ .
- name: Install wheel
run:
python -m pip install signac-flow --progress-bar off --no-index -f dist/
- name: Test with pytest
run:
python -m pytest -v tests/
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: release
path: dist/

publish:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: release
path: dist/
- name: Publish package to TestPyPI
if: ${{ inputs.upload_to_test }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Publish package to PyPI
if: ${{ !inputs.upload_to_test }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Loading

0 comments on commit d543982

Please sign in to comment.