Repository navigation
67 lines (57 loc) · 1.76 KB
/
Copy pathtrain.yml
File metadata and controls
67 lines (57 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: train
run-name: Train${{ inputs.released != '' && format(' {0}', inputs.released) || '' }}${{ inputs.versions != '' && format(' {0}', inputs.versions) || '' }}${{ inputs.dry-run && ' (dry run)' || '' }}
on:
workflow_dispatch:
inputs:
released:
description: repo@version that was just released (set by the finish action)
type: string
default: ''
versions:
description: Repositories to release, "coderpack=2.1.0 protocol=2.0.1" or "all=2.0.0"
type: string
default: ''
dry-run:
description: Print the plan, release nothing
type: boolean
default: false
concurrency:
group: train
cancel-in-progress: false
permissions:
contents: read
jobs:
train:
runs-on: ubuntu-latest
steps:
- id: token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.DEVOPS_APP_ID }}
private-key: ${{ secrets.DEVOPS_APP_KEY }}
owner: ancaria-dev
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: pip install pyyaml
- name: Run the train
env:
GH_TOKEN: ${{ steps.token.outputs.token }}
RELEASED: ${{ inputs.released }}
VERSIONS: ${{ inputs.versions }}
DRY_RUN: ${{ inputs.dry-run }}
run: |
args=(--released "$RELEASED" --versions "$VERSIONS")
if [ "$DRY_RUN" = true ]; then args+=(--dry-run); fi
python scripts/train.py "${args[@]}"
meta:
needs: train
if: ${{ !inputs.dry-run }}
uses: ./.github/workflows/meta.yml
secrets: inherit
cloc:
needs: meta
if: ${{ !inputs.dry-run }}
uses: ./.github/workflows/cloc.yml
secrets: inherit