/ .github / workflows / release-generic.yml
release-generic.yml
  1  name: Generic Release
  2  
  3  on:
  4    workflow_dispatch:
  5      inputs:
  6        target:
  7          description: "Release target key"
  8          required: true
  9          type: choice
 10          options:
 11            - js/sandbox
 12            - js/code-interpreter
 13            - python/sandbox
 14            - python/code-interpreter
 15            - python/mcp/sandbox
 16            - java/sandbox
 17            - java/code-interpreter
 18            - csharp/sandbox
 19            - csharp/code-interpreter
 20            - cli
 21            - server
 22            - docker/execd
 23            - docker/code-interpreter
 24            - docker/ingress
 25            - docker/egress
 26            - k8s/controller
 27            - k8s/task-executor
 28            - helm/opensandbox
 29            - helm
 30        version:
 31          description: "Version to release (e.g. 1.0.5 or v0.3.0)"
 32          required: true
 33          type: string
 34        from_tag:
 35          description: "Optional previous tag override"
 36          required: false
 37          type: string
 38        no_path_filter:
 39          description: "Disable default target path filtering"
 40          required: true
 41          default: false
 42          type: boolean
 43        extra_paths:
 44          description: "Optional extra paths (comma-separated)"
 45          required: false
 46          type: string
 47        initial_release:
 48          description: "Allow release without previous tag"
 49          required: true
 50          default: false
 51          type: boolean
 52        push_tag:
 53          description: "Push new tag to origin"
 54          required: true
 55          default: false
 56          type: boolean
 57        dry_run:
 58          description: "Preview only, no side effects"
 59          required: true
 60          default: true
 61          type: boolean
 62  
 63  permissions:
 64    contents: write
 65  
 66  jobs:
 67    release:
 68      runs-on: ubuntu-latest
 69      steps:
 70        - name: Checkout code
 71          uses: actions/checkout@v6
 72          with:
 73            fetch-depth: 0
 74  
 75        - name: Ensure script executable
 76          run: chmod +x scripts/release/create-release.sh
 77  
 78        - name: Run generic release script
 79          env:
 80            GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 81          run: |
 82            set -euo pipefail
 83            ARGS=(
 84              --target "${{ inputs.target }}"
 85              --version "${{ inputs.version }}"
 86            )
 87  
 88            if [[ -n "${{ inputs.from_tag }}" ]]; then
 89              ARGS+=(--from-tag "${{ inputs.from_tag }}")
 90            fi
 91  
 92            if [[ "${{ inputs.no_path_filter }}" == "true" ]]; then
 93              ARGS+=(--no-path-filter)
 94            fi
 95  
 96            if [[ -n "${{ inputs.extra_paths }}" ]]; then
 97              IFS=',' read -r -a EXTRA_PATHS <<< "${{ inputs.extra_paths }}"
 98              for path in "${EXTRA_PATHS[@]}"; do
 99                trimmed="$(echo "$path" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
100                if [[ -n "$trimmed" ]]; then
101                  ARGS+=(--path "$trimmed")
102                fi
103              done
104            fi
105  
106            if [[ "${{ inputs.initial_release }}" == "true" ]]; then
107              ARGS+=(--initial-release)
108            fi
109  
110            if [[ "${{ inputs.push_tag }}" == "true" ]]; then
111              ARGS+=(--push)
112            fi
113  
114            if [[ "${{ inputs.dry_run }}" == "true" ]]; then
115              ARGS+=(--dry-run)
116            fi
117  
118            scripts/release/create-release.sh "${ARGS[@]}"