diff --git a/.github/workflows/create-release-branches.yml b/.github/workflows/create-release-branches.yml new file mode 100644 index 00000000..2bea403f --- /dev/null +++ b/.github/workflows/create-release-branches.yml @@ -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} diff --git a/release_scripts/branches.py b/release_scripts/branches.py index 906e552e..8eaf47bd 100644 --- a/release_scripts/branches.py +++ b/release_scripts/branches.py @@ -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" @@ -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") @@ -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() diff --git a/release_scripts/requirements.txt b/release_scripts/requirements.txt index 05a50189..64b1adae 100644 --- a/release_scripts/requirements.txt +++ b/release_scripts/requirements.txt @@ -1,6 +1 @@ -# Used for Python on Linux Jenkins node. - -###### Requirements without Version Specifiers ###### GitPython - -###### Requirements with Version Specifiers ######