-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: use a dedicated publish workflow (#248)
- Loading branch information
Showing
2 changed files
with
38 additions
and
33 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,32 @@ | ||
# This will run every time a tag is created and pushed to the repository. | ||
# It calls our tests workflow via a `workflow_call`, and if tests pass | ||
# then it triggers our upload to PyPI for a new release. | ||
name: Publish to PyPI | ||
on: | ||
release: | ||
types: ["published"] | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/tests.yml | ||
|
||
publish: | ||
needs: [tests] | ||
name: Publish to PyPi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.10 | ||
- name: Build package | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_KEY }} |
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
workflow_call: | ||
|
||
jobs: | ||
pre-commit: | ||
|
@@ -36,11 +37,8 @@ jobs: | |
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip hatch | ||
- name: Install hatch | ||
run: pip install hatch | ||
- name: Run tests | ||
run: hatch run test:test -x | ||
|
||
|
@@ -49,32 +47,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip hatch | ||
- name: Install hatch | ||
run: pip install hatch | ||
- name: Build docs | ||
run: | | ||
hatch run doc:build | ||
publish: | ||
name: Publish to PyPi | ||
needs: [tests] | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.8 | ||
- name: Build package | ||
run: | | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_KEY }} | ||
run: hatch run doc:build |