-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create release branch from main and bump minor version * Release from a release branch and bump patch version [noissue]
- Loading branch information
Showing
12 changed files
with
192 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
|
||
BRANCH="$(git branch --show-current)" | ||
|
||
if ! [[ "${BRANCH}" = "main" ]] | ||
then | ||
echo ERROR: This is not the main branch! | ||
exit 1 | ||
fi | ||
|
||
NEW_BRANCH="$(bump2version --dry-run --list release | sed -Ene 's/^new_version=([[:digit:]]+\.[[:digit:]]+)\..*$/\1/p')" | ||
|
||
if [[ -z "${NEW_BRANCH}" ]] | ||
then | ||
echo ERROR: Could not parse new version. | ||
exit 1 | ||
fi | ||
|
||
git branch "${NEW_BRANCH}" | ||
|
||
# Clean changelog snippets. | ||
find CHANGES/ \( -name "*.feature" -o -name "*.bugfix" -o -name "*.doc" -o -name "*.translation" -o -name "*.devel" -o -name "*.misc" \) -exec git rm -f \{\} + | ||
|
||
bumpversion minor --commit --message $'Bump version to {new_version}\n\n[noissue]' --allow-dirty | ||
|
||
git push origin "${NEW_BRANCH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -eu -o pipefail | ||
|
||
BRANCH=$(git branch --show-current) | ||
|
||
if ! [[ "${BRANCH}" =~ ^[0-9]+\.[0-9]+$ ]] | ||
then | ||
echo ERROR: This is not a release branch! | ||
exit 1 | ||
fi | ||
|
||
NEW_VERSION="$(bump2version --dry-run --list release | sed -ne 's/^new_version=//p')" | ||
echo "Release ${NEW_VERSION}" | ||
|
||
if ! [[ "${NEW_VERSION}" == "${BRANCH}"* ]] | ||
then | ||
echo ERROR: Version does not match release branch | ||
exit 1 | ||
fi | ||
|
||
towncrier --yes | ||
bumpversion release --commit --message "Release {new_version}" --tag --tag-name "{new_version}" --tag-message "Release {new_version}" --allow-dirty | ||
bumpversion patch --commit | ||
|
||
git push upstream "${BRANCH}" "${NEW_VERSION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: pulp-cli Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]" | ||
|
||
jobs: | ||
publish-pypi: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: pulp | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
cd pulp-glue | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
cd .. | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
publish-docs: | ||
name: Publish docs | ||
needs: publish-pypi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run publish docs script | ||
env: | ||
PULP_DOCS_KEY: ${{ secrets.PULP_DOCS_KEY }} | ||
run: | | ||
.ci/scripts/publish_docs.sh "${GITHUB_REF##*/}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,25 @@ | ||
name: pulp-cli Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]" | ||
workflow_dispatch | ||
|
||
jobs: | ||
publish-pypi: | ||
name: Publish to PyPI | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: pulp | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
cd pulp-glue | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
cd .. | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
publish-docs: | ||
name: Publish docs | ||
needs: publish-pypi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run publish docs script | ||
env: | ||
PULP_DOCS_KEY: ${{ secrets.PULP_DOCS_KEY }} | ||
run: .ci/scripts/publish_docs.sh "${GITHUB_REF##*/}" | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install bump2version towncrier | ||
- name: Setup git | ||
run: | | ||
git config user.name pulpbot | ||
git config user.email [email protected] | ||
- name: Release | ||
run: .ci/scripts/release.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Create Release Branch | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-release-branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
- name: Setup git | ||
run: | | ||
git config user.name pulpbot | ||
git config user.email [email protected] | ||
- name: Install python dependencies | ||
run: pip install bump2version | ||
- name: Create Release Branch | ||
run: .ci/scripts/create_release_branch.sh | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
title: "Bump dev-version" | ||
body: "" | ||
branch: "bump_version" | ||
delete-branch: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters