Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot authored and mdellweg committed Nov 13, 2023
1 parent d8c0fbe commit f6954e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-249-gca8f021
2021.08.26-251-g45d399d
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
inputs:
release:
description: "Release tag (e.g. 3.2.1)"
required: true
before_script:
description: |
Bash code to run before bindings and docs are built. This should only be used when re-running
Expand Down Expand Up @@ -287,9 +286,5 @@ jobs:
echo "GH Issues $GH_ISSUES"
python .ci/scripts/update_github.py
- name: Tweet
continue-on-error: true
run: python .ci/scripts/tweet.py ${{ github.event.inputs.release }}

- name: Create release on GitHub
run: bash .github/workflows/scripts/create_release_from_tag.sh ${{ github.event.inputs.release }}
26 changes: 7 additions & 19 deletions .github/workflows/scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import textwrap
import requests
import subprocess

from git import Repo
from pathlib import Path
Expand Down Expand Up @@ -56,11 +57,7 @@ def create_release_commits(repo, release_version, plugin_path):
# Second commit: release version
os.system("bump2version release --allow-dirty")

git.add(f"{plugin_path}/pulp_npm/*")
git.add(f"{plugin_path}/docs/conf.py")
git.add(f"{plugin_path}/setup.py")
git.add(f"{plugin_path}/requirements.txt")
git.add(f"{plugin_path}/.bumpversion.cfg")
git.add(f"{plugin_path}")
git.commit("-m", f"Release {release_version}\nGH Issues: {issues}\n\n[noissue]")
sha = repo.head.object.hexsha
short_sha = git.rev_parse(sha, short=7)
Expand All @@ -75,11 +72,7 @@ def create_release_commits(repo, release_version, plugin_path):
if not new_dev_version:
raise RuntimeError("Could not detect new dev version ... aborting.")

git.add(f"{plugin_path}/pulp_npm/*")
git.add(f"{plugin_path}/docs/conf.py")
git.add(f"{plugin_path}/setup.py")
git.add(f"{plugin_path}/requirements.txt")
git.add(f"{plugin_path}/.bumpversion.cfg")
git.add(f"{plugin_path}")
git.commit("-m", f"Bump to {new_dev_version}\n\n[noissue]")
print(f"Release commit == {short_sha}")
print(f"All changes were committed on branch: release_{release_version}")
Expand Down Expand Up @@ -143,6 +136,7 @@ def main():
"release_version",
type=str,
help="The version string for the release.",
nargs="?",
)

args = parser.parse_args()
Expand All @@ -152,20 +146,14 @@ def main():
release_path = os.path.dirname(os.path.abspath(__file__))
plugin_path = release_path.split("/.github")[0]

version = None
with open(f"{plugin_path}/setup.py") as fp:
for line in fp.readlines():
if "version=" in line:
version = re.split("\"|'", line)[1]
if not version:
raise RuntimeError("Could not detect existing version ... aborting.")
release_version = version.replace(".dev", "")
output = subprocess.check_output(["bump2version", "--dry-run", "--list", "release"])
release_version = re.findall(r"\nnew_version=([0-9.]*)\n", output.decode())[0]

print(f"\n\nRepo path: {plugin_path}")
repo = Repo(plugin_path)

release_commit = None
if release_version != release_version_arg:
if release_version_arg and release_version != release_version_arg:
# Look for a commit with the requested release version
for commit in repo.iter_commits():
if f"Release {release_version_arg}\n" in commit.message:
Expand Down

0 comments on commit f6954e5

Please sign in to comment.