diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e285f05..3472061 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 @@ -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__" diff --git a/doc/developer-guide.md b/doc/developer-guide.md index cbc0d0a..7d04c4b 100644 --- a/doc/developer-guide.md +++ b/doc/developer-guide.md @@ -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 diff --git a/justfile b/justfile index 3815213..c5cf40f 100644 --- a/justfile +++ b/justfile @@ -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=" #!/usr/bin/env bash poetry -C $(pwd)/{{project}}/ build - poetry -C $(pwd)/{{project}}/ publish + echo poetry -C $(pwd)/{{project}}/ publish