Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
52 changes: 52 additions & 0 deletions .github/workflows/create-release-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
workflow_dispatch:
inputs:
version:
description: 'The release version in X.x.m format e.g. 12.3.2'
required: true
type: string
remote:
description: 'Update submodules to latest version from remote. Defaults to false, appropriate for a normal release'
default: false
type: boolean
tag:
description: "Commit to branch release from. Defaults to 'HEAD', appropriate for a normal release. May need to set specific TAG here for patch release"
default: "HEAD"
type: string
create_epics_branches:
description: 'Create release branches for EPICS and submodules'
default: true
type: boolean
create_ibex_gui_branch:
description: 'Create release branch for IBEX GUI'
default: true
type: boolean
create_script_gen_branch:
description: 'Create release branch for the Script Generator'
default: true
type: boolean
create_uktena_branch:
description: 'Create release branch for Uktena Python distribution'
default: true
type: boolean

env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
VERSION: ${github.event.inputs.version}
REMOTE: ${github.event.inputs.remote}
TAG: ${github.event.inputs.tag}
EPICS: ${github.event.inputs.create_epics_branches}
IBEX_GUI: ${github.event.inputs.create_ibex_gui_branch}
SCRIPT_GENERATOR: ${github.event.inputs.create_script_gen_branch}
UKTENA: ${github.event.inputs.create_uktena_branch}

jobs:
create_release_branches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install -r release_scripts/requirements.txt
- run: python --version ${github.event.inputs.version}
9 changes: 1 addition & 8 deletions release_scripts/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
EPICS_REPO_URL = "https://github.com/ISISComputingGroup/EPICS.git"
IBEX_REPO_URL = "https://github.com/ISISComputingGroup/ibex_gui.git"
UKTENA_URL = "https://github.com/ISISComputingGroup/uktena.git"
JSON_BOURNE_URL = "https://github.com/ISISComputingGroup/JSON_bourne.git"

EPICS_DIR = "EPICS"
IBEX_DIR = "IBEX"
SCRIPT_GEN_DIR = "SCRIPT_GEN"
UKTENA_DIR = "UKTENA"
JSON_BOURNE_DIR = "JSON_bourne"

INSTETC_TEMPLATE_LOCAL_PATH = os.path.join(
"INSTETC", "INSTETC-IOC-01App", "Db", "svn-revision.db.tmpl"
Expand Down Expand Up @@ -125,7 +123,7 @@ def create(self, url: str, dir: str, branch_name: str, submodules: bool = False)
logging.info(f"Cloning '{url}' into '{dir}'.")
self.repo = git.Repo.clone_from(url=url, to_path=dir)
if branch_name in self.repo.references:
logging.error(f"Branch name '{branch_name}' " f"already exists for repo '{url}'.")
logging.error(f"Branch name '{branch_name}' already exists for repo '{url}'.")
sys.exit(1)

source = os.getenv("TAG")
Expand Down Expand Up @@ -266,8 +264,3 @@ def push(self, submodules: bool = False) -> None:
uktena = ReleaseBranch()
uktena.create(UKTENA_URL, UKTENA_DIR, f"Release_{args.version}")
uktena.push()

if os.getenv("JSON_BOURNE") == "true":
json_bourne = ReleaseBranch()
json_bourne.create(JSON_BOURNE_URL, JSON_BOURNE_DIR, f"Release_{args.version}")
json_bourne.push()
5 changes: 0 additions & 5 deletions release_scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
# Used for Python on Linux Jenkins node.

###### Requirements without Version Specifiers ######
GitPython

###### Requirements with Version Specifiers ######
Loading