Skip to content
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

Update release workflow #215

Merged
merged 6 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
34 changes: 34 additions & 0 deletions .github/release_workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Release Workflow

This document outlines the release workflow for publishing to PyPI and TestPyPI using GitHub Actions.

## Creating a New Release

To create a new release, follow these steps:

1. **Prepare the Release:**
- Create a new branch for the release (i.e. `v24.XX`) from `develop`.
- Increment the following:
- The version number in the `pyproject.toml` file following CalVer versioning.
- The`CHANGELOG.md` version with the changes for the new version.
- Open a PR to the `main` branch. Once the PR is merged, proceed to the next step.

2. **Tag the Release:**
- Create a new Git tag for the release. For a full release, use a tag like `v24.2`. For a release candidate, use a tag like `v24.2-rc.1`.
BradyPlanden marked this conversation as resolved.
Show resolved Hide resolved
- Push the tag to the remote repository: `git push origin <tag_name>`.

3. **Create a GitHub Release:**
- Go to the "Releases" section of on GitHub.
- Click "Draft a new release."
- Enter the tag you created in the "Tag version" field.
- Fill in the release title and description. Add any major changes and link to the `CHANGELOG.md` for a list of total changes.
- If it's a pre-release (release candidate), check the "This is a pre-release" checkbox.
- Click "Publish release" to create the release.

4. **Monitor the Workflow:**
- Go to the "Actions" tab of your repository to monitor the workflow's progress.
- The workflow will build the distribution packages and then publish them to PyPI or TestPyPI, depending on whether the release is a full release or a pre-release.

5. **Verify the Release:**
- Check PyPI or TestPyPI to ensure that your package is available and has been updated to the new version.
- Test installing the package using `pip` to ensure everything works as expected.
12 changes: 8 additions & 4 deletions .github/workflows/release_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.12"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
Expand All @@ -36,8 +36,7 @@ jobs:
if: >
startsWith(github.ref, 'refs/tags/') &&
!contains(github.ref, 'rc')
needs:
- build
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
Expand All @@ -53,6 +52,9 @@ jobs:
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
BradyPlanden marked this conversation as resolved.
Show resolved Hide resolved

github-release:
name: >-
Expand Down Expand Up @@ -113,3 +115,5 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
Loading