Skip to content

Commit

Permalink
[DOCS] Py Pkg Gen v2.0.2-dev Release
Browse files Browse the repository at this point in the history
Release Version '2.0.02-dev into 'master' Branch
  • Loading branch information
boromir674 authored Feb 27, 2024
2 parents 6208e0c + 5e7d68c commit 0a9a5c7
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 15 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/merge-rt-in-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAIN_BR: 'master'
TRAIN: 'release-train'
RELEASE_BR: 'release'
steps:
Expand All @@ -43,7 +44,7 @@ jobs:
- name: Ensure Release Branch exists, before PR
run: |
git branch --track "${{ env.RELEASE_BR }}" "origin/${{ env.RELEASE_BR }}" || echo "Branch '${{ env.RELEASE_BR }}' does NOT exist in remote Origin"
git checkout ${{ env.RELEASE_BR }} || (git checkout -b ${{ env.RELEASE_BR }} && git push origin -u ${{ env.RELEASE_BR }})
git checkout ${{ env.RELEASE_BR }} || (git checkout ${{ env.MAIN_BR }} && git checkout -b ${{ env.RELEASE_BR }} && git push origin -u ${{ env.RELEASE_BR }})
####### PR: Train --> Release #######
- name: "Create PR 'head': ${{ env.TRAIN }} --> 'base': ${{ env.RELEASE_BR }}"
Expand Down Expand Up @@ -87,3 +88,5 @@ jobs:
##### Auto Merge: Train --> Release #####
- name: 'Merge PR ${{ env.TRAIN }} --> ${{ env.RELEASE_BR }}'
run: gh pr merge "${{ env.TRAIN }}" --auto --delete-branch --merge
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # allow event to trigger "listener" Workflows
3 changes: 3 additions & 0 deletions .github/workflows/policy_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ jobs:
config: |
paths-ignore:
- 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/'
- 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/**'
- 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/**/*'
- 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/*'
- 'src/cookiecutter_python/{{ cookiecutter.project_slug }}/tests/test_cli.py'
# disable-default-queries: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tag-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
run: echo "PROD_TAG=v${{ env.SEMVER }}" >> $GITHUB_ENV

# Trigger CI/CD for 'Production Release'
- run: git config --global user.name "Konstantinos Lampridis"
- run: git config --global user.email "[email protected]"

- name: "Push '${{ env.PROD_TAG }}' to trigger CI/CD for 'Production Release'"
run: |
git tag "${{ env.PROD_TAG }}" -m "Production Release ${{ env.PROD_TAG }}"
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@
Changelog
=========

2.0.2-dev (2024-02-27)
======================

Changes
^^^^^^^

documentation
"""""""""""""
- improve clean-up instructions in Git Ops Cheatsheet Page

ci
""
- add glob patterns to exclude Template Project contents from CodeQL

release
"""""""
- bump version to 2.0.2-dev

gitops
""""""
- support automatic Source Sem Ver update for '-rc' and '-dev' sem ver metadata
- allow workflows to trigger on event 'merge to Release'
- add user name and email before tagging prod tag on Main/Master
- ensure release branch is on master, in 'RT in Release' Workflow


2.0.1 (2024-02-25)
==================

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ Free/Libre and Open Source Software (FLOSS)

.. Github Releases & Tags
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.0.1/master?color=blue&logo=github
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v2.0.2-dev/master?color=blue&logo=github
:alt: GitHub commits since tagged version (branch)
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.0.1..master
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v2.0.2-dev..master

.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
:alt: GitHub commits since latest release (by SemVer)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
author = 'Konstantinos Lampridis'

# The full version, including alpha/beta/rc tags
release = '2.0.1'
release = '2.0.2-dev'

# -- General configuration ---------------------------------------------------

Expand Down
25 changes: 20 additions & 5 deletions docs/contents/35_development/gitops-v2-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,28 @@ gh release create "$tt"
```
**--> !! DONE !! <--**

Clean Git with:
Clean Origin Git with:

```shell
git checkout release && git rebase master
# Delete Git Ops Tags
# Delete Git Ops TAGS
git push origin -d board-request
git push origin -d auto-prod
# Delete Git Ops branches
git push origin -d board-request
# Delete Git Ops BRANCHES
git push origin -d boarding-auto
git push origin -d test-docs
git push origin -d test-distro
git push origin -d test-distro-docs
git push origin -d direct-onboarding
git push origin -d release-train
```

Clean Local with:
```shell
git tag -d board-request
git tag -d auto-prod
```
git checkout release && git rebase master
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "poetry.core.masonry.api"
## Also renders on pypi as 'subtitle'
[tool.poetry]
name = "cookiecutter_python"
version = "2.0.1"
version = "2.0.2-dev"
description = "1-click Generator of Python Project, from Template with streamlined \"DevOps\" using a powerful CI/CD Pipeline."
authors = ["Konstantinos Lampridis <[email protected]>"]
maintainers = ["Konstantinos Lampridis <[email protected]>"]
Expand Down
14 changes: 10 additions & 4 deletions scripts/distro-sem-ver-bump.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
#!/usr/bin/env sh

VERSION="${1}"
GITHUB_ORG="${2:-boromir674}"
REPO="${3:-cookiecutter-python}"
# GITHUB_ORG="${2:-boromir674}"
# REPO="${3:-cookiecutter-python}"


# CONSTANTS
# Sem Ver Major Minor Patch + Pre-release metadata
regex="[0-9]+\.[0-9]+\.[0-9]+(?:\-[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?"

VERSION_VAR='__version__'


# DISTRO Sem Ver

## Python Poetry BUILD - Bound - Sem Ver
PYPROJECT='pyproject.toml'
sed -i.bak -E "s/(version = ['\"])[0-9]+\.[0-9]+\.[0-9]+(['\"])/\\1${VERSION}\\2/" "${PYPROJECT}" && rm "${PYPROJECT}.bak"
# sed -i.bak -E "s/(version = ['\"])[0-9]+\.[0-9]+\.[0-9]+(['\"])/\\1${VERSION}\\2/" "${PYPROJECT}" && rm "${PYPROJECT}.bak"
sed -i.bak -E "s/(version = ['\"])${regex}(['\"])/\\1${VERSION}\\2/" "${PYPROJECT}" && rm "${PYPROJECT}.bak"

## Project Specific - Bound - Sem Ver
INIT_FILE='src/cookiecutter_python/__init__.py'
sed -i.bak -E "s/(${VERSION_VAR} = ['\"])[0-9]+\.[0-9]+\.[0-9]+(['\"])/\\1${VERSION}\\2/" "${INIT_FILE}" && rm "${INIT_FILE}.bak"
# sed -i.bak -E "s/(${VERSION_VAR} = ['\"])[0-9]+\.[0-9]+\.[0-9]+(['\"])/\\1${VERSION}\\2/" "${INIT_FILE}" && rm "${INIT_FILE}.bak"
sed -i.bak -E "s/(${VERSION_VAR} = ['\"])${regex}(['\"])/\\1${VERSION}\\2/" "${INIT_FILE}" && rm "${INIT_FILE}.bak"

## Other Builds

Expand Down
2 changes: 1 addition & 1 deletion src/cookiecutter_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '2.0.1'
__version__ = '2.0.2-dev'

from . import _logging # noqa

0 comments on commit 0a9a5c7

Please sign in to comment.