From cc928ed21931ded8bc9bc2fe7d3d8dc34f4de07d Mon Sep 17 00:00:00 2001 From: Jorge Morgado Vega Date: Mon, 22 Jul 2024 12:47:28 +0200 Subject: [PATCH] Add support for releasing specific recipes --- .github/workflows/release.yml | 6 +++++- build.py | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f05eded..4397e06 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,10 @@ on: type: string required: true description: "Version number" + only_recipes: + type: string + required: false + description: "Only recipes to release (comma separated, no spaces, e.g. 'recipe1,recipe2')" jobs: release: @@ -23,7 +27,7 @@ jobs: - name: Install python dependencies run: pip install -r requirements.txt - name: Run build - run: python build.py + run: python build.py ${{ github.event.inputs.only_recipes }} - uses: ncipollo/release-action@v1 with: name: "trajectory datasets" diff --git a/build.py b/build.py index 0c0735b..da4d71a 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,6 @@ import json import logging +import sys import zipfile from pathlib import Path from typing import Callable, List @@ -100,8 +101,11 @@ def process_recipe(output_dir: Path, recipe_py_path: Path): def main(): + only_recipies = sys.argv[1].split(",") if len(sys.argv) > 1 else None output_dir = Path("./builds") for dataset_recipe in RECIPIES_DIR.glob("[!_]*.py"): + if dataset_recipe.stem not in only_recipies: + continue try: process_recipe(output_dir, dataset_recipe) except AttributeError: