Skip to content

Commit 591d3a0

Browse files
Merge pull request #257 from ISISComputingGroup/gha_create_release_branches
move release branch creation to GHA
2 parents 8b82c64 + 06977cd commit 591d3a0

File tree

3 files changed

+53
-13
lines changed

3 files changed

+53
-13
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
version:
5+
description: 'The release version in X.x.m format e.g. 12.3.2'
6+
required: true
7+
type: string
8+
remote:
9+
description: 'Update submodules to latest version from remote. Defaults to false, appropriate for a normal release'
10+
default: false
11+
type: boolean
12+
tag:
13+
description: "Commit to branch release from. Defaults to 'HEAD', appropriate for a normal release. May need to set specific TAG here for patch release"
14+
default: "HEAD"
15+
type: string
16+
create_epics_branches:
17+
description: 'Create release branches for EPICS and submodules'
18+
default: true
19+
type: boolean
20+
create_ibex_gui_branch:
21+
description: 'Create release branch for IBEX GUI'
22+
default: true
23+
type: boolean
24+
create_script_gen_branch:
25+
description: 'Create release branch for the Script Generator'
26+
default: true
27+
type: boolean
28+
create_uktena_branch:
29+
description: 'Create release branch for Uktena Python distribution'
30+
default: true
31+
type: boolean
32+
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
35+
VERSION: ${github.event.inputs.version}
36+
REMOTE: ${github.event.inputs.remote}
37+
TAG: ${github.event.inputs.tag}
38+
EPICS: ${github.event.inputs.create_epics_branches}
39+
IBEX_GUI: ${github.event.inputs.create_ibex_gui_branch}
40+
SCRIPT_GENERATOR: ${github.event.inputs.create_script_gen_branch}
41+
UKTENA: ${github.event.inputs.create_uktena_branch}
42+
43+
jobs:
44+
create_release_branches:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.12'
51+
- run: python -m pip install -r release_scripts/requirements.txt
52+
- run: python --version ${github.event.inputs.version}

release_scripts/branches.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
EPICS_REPO_URL = "https://github.com/ISISComputingGroup/EPICS.git"
1313
IBEX_REPO_URL = "https://github.com/ISISComputingGroup/ibex_gui.git"
1414
UKTENA_URL = "https://github.com/ISISComputingGroup/uktena.git"
15-
JSON_BOURNE_URL = "https://github.com/ISISComputingGroup/JSON_bourne.git"
1615

1716
EPICS_DIR = "EPICS"
1817
IBEX_DIR = "IBEX"
1918
SCRIPT_GEN_DIR = "SCRIPT_GEN"
2019
UKTENA_DIR = "UKTENA"
21-
JSON_BOURNE_DIR = "JSON_bourne"
2220

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

131129
source = os.getenv("TAG")
@@ -266,8 +264,3 @@ def push(self, submodules: bool = False) -> None:
266264
uktena = ReleaseBranch()
267265
uktena.create(UKTENA_URL, UKTENA_DIR, f"Release_{args.version}")
268266
uktena.push()
269-
270-
if os.getenv("JSON_BOURNE") == "true":
271-
json_bourne = ReleaseBranch()
272-
json_bourne.create(JSON_BOURNE_URL, JSON_BOURNE_DIR, f"Release_{args.version}")
273-
json_bourne.push()

release_scripts/requirements.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
# Used for Python on Linux Jenkins node.
2-
3-
###### Requirements without Version Specifiers ######
41
GitPython
5-
6-
###### Requirements with Version Specifiers ######

0 commit comments

Comments
 (0)