-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(actions): Replace Travis CI with GitHub Actions workflow
- Loading branch information
Showing
2 changed files
with
104 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build and Test Package | ||
strategy: | ||
matrix: | ||
version: | ||
- '3.7' | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.version }} | ||
|
||
- name: Install package | ||
run: pip install . | ||
|
||
- name: Run tests | ||
run: python -m unittest discover -v | ||
|
||
package: | ||
name: Build Package | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.version }} | ||
|
||
- name: Install pypa/build | ||
run: pip install build | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
|
||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
test-deploy: | ||
name: Deploy Package to Test PyPI | ||
if: ${{ ! startsWith(github.ref, 'refs/tags/') }} | ||
needs: [package] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/sphinx-multiversion | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download the packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish packages to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
deploy: | ||
name: Deploy Package to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: [package] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/sphinx-multiversion | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download the packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish packages to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
This file was deleted.
Oops, something went wrong.