From b6808aac14d5ba96fe5445a3ad36aa5b70b49d36 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Tue, 12 Jul 2022 11:29:21 +0530 Subject: [PATCH 01/10] github action --- .github/workflows/python-publish-to-pypi.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/python-publish-to-pypi.yaml diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml new file mode 100644 index 00000000..9ed9ab89 --- /dev/null +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -0,0 +1,42 @@ +name: Publish to Pypi + +on: + release: + types: [published] + tags: + - python.* + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Build wheels + working-directory: ./python/sqlcommenter-python + run: python -m build + + - name: Install twine + working-directory: ./python/sqlcommenter-python + run: | + pip install twine + + - name: Publish to TestPyPI + working-directory: ./python/sqlcommenter-python + env: + TWINE_USERNAME: '__token__' + TWINE_PASSWORD: ${{ secrets.test_pypi_token }} + run: | + twine upload --repository testpypi --skip-existing --verbose dist/* + + - name: Publish to PyPI + working-directory: ./python/sqlcommenter-python + env: + TWINE_USERNAME: '__token__' + TWINE_PASSWORD: ${{ secrets.pypi_password }} + run: | + twine upload --skip-existing --verbose dist/* \ No newline at end of file From e6a48032bdfc53d0c75afa3391a3be80fadb0fb5 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Tue, 12 Jul 2022 11:51:47 +0530 Subject: [PATCH 02/10] github action --- .github/workflows/python-publish-to-pypi.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index 9ed9ab89..aa7132e0 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -1,8 +1,7 @@ name: Publish to Pypi on: - release: - types: [published] + push: tags: - python.* From 19188ee3c862e5bc1f280949b16e2b05ed1f1d02 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Tue, 12 Jul 2022 12:40:25 +0530 Subject: [PATCH 03/10] github action --- .github/workflows/python-publish-to-pypi.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index aa7132e0..b3c35400 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -15,14 +15,10 @@ jobs: with: python-version: '3.7' - - name: Build wheels - working-directory: ./python/sqlcommenter-python - run: python -m build - - - name: Install twine + - name: Install build & twine working-directory: ./python/sqlcommenter-python run: | - pip install twine + pip install build twine - name: Publish to TestPyPI working-directory: ./python/sqlcommenter-python From ff8ef1f5b8434fec14c2658b8f72e87a2d349269 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Tue, 12 Jul 2022 13:54:03 +0530 Subject: [PATCH 04/10] github action --- .github/workflows/python-publish-to-pypi.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index b3c35400..82e0635e 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -16,9 +16,11 @@ jobs: python-version: '3.7' - name: Install build & twine + run: pip install twine build + + - name: Build wheels working-directory: ./python/sqlcommenter-python - run: | - pip install build twine + run: python -m build - name: Publish to TestPyPI working-directory: ./python/sqlcommenter-python From 7deffdb2bf50d0c53f6047ae88a632f5d4dc2a4d Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Thu, 14 Jul 2022 16:27:52 +0530 Subject: [PATCH 05/10] Added RELEASE.md --- python/sqlcommenter-python/RELEASE.md | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 python/sqlcommenter-python/RELEASE.md diff --git a/python/sqlcommenter-python/RELEASE.md b/python/sqlcommenter-python/RELEASE.md new file mode 100644 index 00000000..abe644c7 --- /dev/null +++ b/python/sqlcommenter-python/RELEASE.md @@ -0,0 +1,38 @@ +# Releases + +This page describes the release process. The release will be done by the maintainers. + +## How to cut an individual release + +### Branch management and versioning strategy + +We use [Semantic Versioning](https://semver.org/). + +We maintain a separate branch for each release, named `release-.`, e.g. `release-1.1`, `release-2.0`. + +The usual flow is to merge new features and changes into the master branch and to merge bug fixes into the latest release branch. Bug fixes are then merged into master from the latest release branch. The master branch should always contain all commits from the latest release branch. As long as master hasn't deviated from the release branch, new commits can also go to master, followed by merging master back into the release branch. + +If a bug fix got accidentally merged into master after non-bug-fix changes in master, the bug-fix commits have to be cherry-picked into the release branch, which then have to be merged back into master. Try to avoid that situation. + +Maintaining the release branches for older minor releases happens on a best effort basis. + +### Prepare your release + +This helps ongoing PRs to get their changes in the right place, and to consider whether they need cherry-picked. + +1. Make a PR to update `CHANGELOG.md` on master + - Add a new section for the new release so that "unreleased" is blank and at the top. + - New section should say "## x.y.0 - release date". +2. This PR will get merged. + +### Create release branch + +To prepare release branch, first create new release branch (release-X.Y) in repository from master commit of your choice + +### Publish a stable release + +To publish a stable release: + +1. Do not change the release branch directly; make a PR to the release-X.Y branch with VERSION and any CHANGELOG changes. +2. After merging your PR to release branch, `git tag` the new release from release branch. +3. Merge the release branch `release-x.y` to `master` \ No newline at end of file From eb50285b9a48715e6b475c0d85cbe3c53699f281 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Thu, 14 Jul 2022 16:30:49 +0530 Subject: [PATCH 06/10] changing python tag format --- .github/workflows/python-publish-to-pypi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index 82e0635e..198541fe 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -3,7 +3,7 @@ name: Publish to Pypi on: push: tags: - - python.* + - python-* jobs: publish: From 8a616b5e2e930f1300e380a85cf995632dd4ac90 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Thu, 14 Jul 2022 16:33:17 +0530 Subject: [PATCH 07/10] Adding newline at the end of python-publish-to-pypi.yaml --- .github/workflows/python-publish-to-pypi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index 198541fe..5c525a2c 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -36,4 +36,4 @@ jobs: TWINE_USERNAME: '__token__' TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | - twine upload --skip-existing --verbose dist/* \ No newline at end of file + twine upload --skip-existing --verbose dist/* From 9151a8d2aa070a6d9af2e4ced16578ed85a2bd58 Mon Sep 17 00:00:00 2001 From: Thiyagu55 Date: Thu, 14 Jul 2022 16:45:34 +0530 Subject: [PATCH 08/10] Adding python- tag related info the RELEASE.md --- .github/workflows/python-publish-to-pypi.yaml | 4 ++-- python/sqlcommenter-python/RELEASE.md | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-publish-to-pypi.yaml b/.github/workflows/python-publish-to-pypi.yaml index 5c525a2c..53a697d0 100644 --- a/.github/workflows/python-publish-to-pypi.yaml +++ b/.github/workflows/python-publish-to-pypi.yaml @@ -1,4 +1,4 @@ -name: Publish to Pypi +name: Publish Python to Pypi on: push: @@ -6,7 +6,7 @@ on: - python-* jobs: - publish: + publish-python-to-pypi: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/python/sqlcommenter-python/RELEASE.md b/python/sqlcommenter-python/RELEASE.md index abe644c7..d30db9c7 100644 --- a/python/sqlcommenter-python/RELEASE.md +++ b/python/sqlcommenter-python/RELEASE.md @@ -35,4 +35,6 @@ To publish a stable release: 1. Do not change the release branch directly; make a PR to the release-X.Y branch with VERSION and any CHANGELOG changes. 2. After merging your PR to release branch, `git tag` the new release from release branch. -3. Merge the release branch `release-x.y` to `master` \ No newline at end of file +3. Tag should be prefixed with `python-` +4. Once the release occurs `publish-python-to-pypi` workflow job will get executed and will publish the library to testpypi and pypi +5. When build succeeds, merge the release branch `release-x.y` to `master` From b4a3a1f60b0ad98142873125372f81ec89312ce2 Mon Sep 17 00:00:00 2001 From: Manu Paliwal Date: Thu, 15 Dec 2022 18:39:05 +0530 Subject: [PATCH 09/10] Update RELEASE.md --- python/sqlcommenter-python/RELEASE.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sqlcommenter-python/RELEASE.md b/python/sqlcommenter-python/RELEASE.md index d30db9c7..969b953c 100644 --- a/python/sqlcommenter-python/RELEASE.md +++ b/python/sqlcommenter-python/RELEASE.md @@ -23,7 +23,8 @@ This helps ongoing PRs to get their changes in the right place, and to consider 1. Make a PR to update `CHANGELOG.md` on master - Add a new section for the new release so that "unreleased" is blank and at the top. - New section should say "## x.y.0 - release date". -2. This PR will get merged. +2. Change the release version in `setup.py` file. +3. This PR will get merged. ### Create release branch From ff525cfbfc752b3deb350fdfd2f8930219d4aed4 Mon Sep 17 00:00:00 2001 From: Manu Paliwal Date: Fri, 16 Dec 2022 14:04:37 +0530 Subject: [PATCH 10/10] Update python-tests.yaml --- .github/workflows/python-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index c267c0d9..0ae3910c 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -33,7 +33,7 @@ jobs: with: python-version: ${{ env[matrix.python-version] }} - name: Install tox - run: pip install -U tox-factor + run: pip install tox tox-gh-actions - name: run tox run: tox -e '${{ matrix.python-version }}-{django21,django22,django30,django31,django32,psycopg2,flask,generic,sqlalchemy}' working-directory: ./python/sqlcommenter-python