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

#17: Release pytest saas 0.2.0 #21

Merged
merged 12 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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
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
* Publish to pypi
ckunki marked this conversation as resolved.
Show resolved Hide resolved
* Create a release on GitHub
ckunki marked this conversation as resolved.
Show resolved Hide resolved

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`.
ckunki marked this conversation as resolved.
Show resolved Hide resolved

In order to create release for one of the plugins
ckunki marked this conversation as resolved.
Show resolved Hide resolved
1. Open the GitHub repository in your browser
2. On top select tab "Actions"
ckunki marked this conversation as resolved.
Show resolved Hide resolved
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"
ckunki marked this conversation as resolved.
Show resolved Hide resolved

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
Loading