-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dependabot and a simple build/publish workflow
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 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,12 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
# Open update PRs in groups rather than one-by-one | ||
groups: | ||
actions: | ||
patterns: | ||
- "*" |
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,55 @@ | ||
name: Build and upload to PyPI | ||
|
||
on: | ||
# Allow manual triggering of the workflow, but note that the upload | ||
# to PyPI step will not run manual trigger. | ||
workflow_dispatch: | ||
# Run workflow on pullrequests, but note that the upload to PyPI step | ||
# will not run on pull requests. | ||
pull_request: | ||
# Run workflow on push to main branch, but note that the upload to | ||
# PyPI step will not run on pushes. We could change that if we wanted | ||
# to have it publish on tags -- see the upload_pypi job below. | ||
push: | ||
branches: | ||
- main | ||
# Run workflow on GitHub release done through the UI -- this is the only | ||
# time the upload to PyPI step will run. | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build_wheel_sdist: | ||
name: Build wheel and sdist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheel and sdist | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheel-sdist | ||
path: dist/* | ||
|
||
upload_pypi: | ||
needs: [build_wheel_sdist] | ||
runs-on: ubuntu-latest | ||
environment: publish | ||
permissions: | ||
id-token: write | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) | ||
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
# unpacks all CIBW artifacts into dist/ | ||
pattern: wheel-sdist | ||
path: dist | ||
merge-multiple: true | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 |