Skip to content

Commit

Permalink
#17: Release pytest saas 0.2.0 (#21)
Browse files Browse the repository at this point in the history
* Prepare release 0.2.0

Co-authored-by: Mikhail Beck <[email protected]>
  • Loading branch information
ckunki and ahsimb authored Jun 4, 2024
1 parent d727175 commit 2380da9
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 18 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
name: Continues Delivery (Release)
name: Continuous Delivery (Release)

on:
workflow_dispatch:
inputs:
project:
description: 'Project to release'
required: true
default: 'pytest-itde'
default: 'pytest-saas'
type: choice
options:
- "pytest-saas"
- "pytest-itde"
version:
description: 'Version number for the release'
required: True
required: true
type: int
jobs:
Release:
runs-on: ubuntu-20.04

steps:
- name: Check
run: |
echo "Stub: validate that all preconditions for the release are meet"
- name: Fail if not running on main branch
if: ${{ github.ref != 'refs/heads/main' }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('Not running on main branch, github.ref is ${{ github.ref }}. Please start this workflow only on main')
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Development Environment
uses: ./.github/actions/pytest-plugins-environment

- name:
run: |
just release ${{ inputs.project }} ${{ inputs.version }}
just release ${PROJECT}
gh release create ${TAG} \
--title ${TAG} \
--notes-file ./${PROJECT}/doc/changes/changes_${VERSION}.md \
--latest \
--target main \
${PROJECT}/dist/*
env:
TAG: "${{ inputs.project }}-${{ inputs.version }}"
PROJECT: "${{ inputs.project }}"
VERSION: "${{ inputs.version }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
26 changes: 26 additions & 0 deletions doc/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,29 @@ 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
* Publishing to pypi
* Creating a release on GitHub

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

In order to create a release for one of the plugins
1. Open the GitHub repository in your browser
2. On top select the 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 the 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
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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>"
Expand Down
2 changes: 2 additions & 0 deletions pytest-saas/doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

* [unreleased](unreleased.md)
* [0.2.0](changes_0.2.0.md)
* [0.1.0](changes_0.1.0.md)

<!--- This MyST Parser Sphinx directive is necessary to keep Sphinx happy. We need list here all release letters again, because release droid and other scripts assume Markdown --->
Expand All @@ -9,6 +10,7 @@
hidden:
---
unreleased
changes_0.2.0
changes_0.1.0
```
13 changes: 13 additions & 0 deletions pytest-saas/doc/changes/changes_0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 0.2.0 - 2024-06-04

## Feature

* #18: Implemented keep alive for saas-database

## Bugfixes

* #19: Fixed removing ip whitelist rule at the end of the test session

## Refactorings

* #17: Added workflow for releasing a single plugin
8 changes: 0 additions & 8 deletions pytest-saas/doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
# Unreleased

## Feature

* #18: Implemented keep alive for saas-database

## Bugfixes

* #19: Fixed removing ip whitelist rule at the end of the test session
2 changes: 1 addition & 1 deletion pytest-saas/exasol/pytest_saas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
# Do not edit this file manually!
# If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`.
MAJOR = 0
MINOR = 1
MINOR = 2
PATCH = 0
VERSION = f"{MAJOR}.{MINOR}.{PATCH}"
2 changes: 1 addition & 1 deletion pytest-saas/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pytest-exasol-saas"
version = "0.1.0"
version = "0.2.0"
description = ""
authors = ["Christoph Kuhnke <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 2380da9

Please sign in to comment.