Skip to content

Commit

Permalink
Described release process in developer guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Jun 4, 2024
1 parent d02eb9c commit 9593b78
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
# script: |
# core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main')

- name: Check
run: |
echo "Stub: validate that all preconditions for the release are met"
- name: SCM Checkout
uses: actions/checkout@v4

Expand All @@ -40,11 +36,12 @@ jobs:
- name:
run: |
TAG="${{ inputs.project }}-${{ inputs.version }}"
echo just release ${{ inputs.project }} ${{ inputs.version }}
echo gh release create ${TAG} \
just release ${{ inputs.project }}
gh release create ${TAG} \
--title ${TAG} \
--notes-file ./${{ inputs.project }}/doc/changes/changes_${{ inputs.version }}.md \
--latest --target main \
--latest \
--target main \
dist/*
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
Expand Down
28 changes: 28 additions & 0 deletions doc/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,31 @@ These test cases are only executed by the following GitHub workflows
Both of these workflows can be run manually, workflow `ci-main.yml` is executed automatically at the 7th day of each month.

For merging a pull request to branch `main` workflow `ci-slow.yml` needs to be run and terminate successfully.

## Release

`pytest-plugins` is a multi-project repository. Each of the plugins can be released independently.

Releasing a single plugin includes
* Publish to pypi
* Create a release on GitHub

This requires to have a dedicated Git-tag for each release of each of the
plugins. The convention is to use the name of the plugin as prefix followed
by a dash character and the version of the plugin, e.g. `pytest-saas-0.1.0`.

In order to create release for one of the plugins
1. Open the GitHub repository in your browser
2. On top select tab "Actions"
3. On the left hand side select action "Continous Delivery (Release)"
4. On the right hand click button "Run workflow"
5. Select banch "main"
6. Select the project, e.g. "pytest-saas"
7. Enter the version number, e.g. `0.2.0`
8. Click button "Run workflow"

The workflow will then
* Checkout the project
* Build the selected plugin
* Publish it to pypi
* Create a Git-tag and a GitHub release using the naming convention described above
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ test +projects=PROJECTS:
sys.exit(rc)

# Create a release
release project version:
release project:
@echo "Ensure environment variables are set:"
@echo "- POETRY_HTTP_BASIC_PYPI_USERNAME=__token__"
@echo "- POETRY_HTTP_BASIC_PYPI_PASSWORD=<your token>"
#!/usr/bin/env bash
poetry -C $(pwd)/{{project}}/ build
poetry -C $(pwd)/{{project}}/ publish
echo poetry -C $(pwd)/{{project}}/ publish

0 comments on commit 9593b78

Please sign in to comment.