Skip to content

Release Workflow #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

# based on https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

on:
push:
tags: ["v*"]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: python -m pip install --upgrade build
- name: Build
run: python3 -m build
- name: Store packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/maturin-import-hook
permissions:
id-token: write
if: "startsWith(github.ref, 'refs/tags/')"
needs: [build]
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
9 changes: 9 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,12 @@ of those linters.
The configuration starts with all `ruff` lints enabled with a list of specifically disabled lints.
If you are writing new code that is triggering a lint that you think ought to be disabled, you can suggest this in
a PR, but generally stick to conforming to the suggested linter rules.

## Making a release

1. Bump the version number in `pyproject.toml`.
2. Update `Changelog.md` to reflect the new changes.
3. Check out the commit you want to make a release from.
4. Run `git tag <version>` e.g. `git tag v0.1.0`.
5. Run `git push origin <version>` e.g. `git tag v0.1.0`.
- This will trigger the 'release' github action which will upload to PyPi.