Skip to content

Commit a5231ee

Browse files
d-perlwakonig
authored andcommitted
wip feat: workflow to update all children
1 parent 2bbb876 commit a5231ee

4 files changed

Lines changed: 90 additions & 7 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Trigger update pipeline"
2+
description: "Call a workflow"
3+
inputs:
4+
REPO_NAME:
5+
required: true
6+
description: "Identifier of the repo in which to trigger an update"
7+
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: create update in child repo
13+
shell: bash
14+
run: |
15+
curl -X 'POST' \
16+
"https://gitea.psi.ch/api/v1/repos/bec/${{ inputs.REPO_NAME }}/actions/workflows/create_update_pr.yml/dispatches?token=${{ secrets.CI_DEPLOY_GITEA }}" \
17+
-H 'accept: application/json' \
18+
-H 'Content-Type: application/json' \
19+
\"ref\": \"refs/heads/main\"
20+
}"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Update Beamline Plugin Repositories
2+
on:
3+
workflow_dispatch
4+
5+
jobs:
6+
update_beamline_plugins:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
repo_name: ["addams_bec",
11+
"csaxs_bec",
12+
"debye_bec",
13+
"microxas_bec",
14+
"phoenix_bec",
15+
"pxi_bec",
16+
"pxii_bec",
17+
"pxiii_bec",
18+
"sim_bec",
19+
"superxas_bec",
20+
"tomcat_bec",
21+
"xtreme_bec"]
22+
steps:
23+
- uses: ./.github/actions/trigger_child_update
24+
with:
25+
REPO_NAME: ${{ matrix.repo_name }}
26+
27+

template/.gitea/workflows/ci.yml.jinja

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ jobs:
4646
with:
4747
python-version: "{% raw %}${{ inputs.PYTHON_VERSION || '3.11' }}{% endraw %}"
4848

49+
- name: Checkout BEC Plugin Repository
50+
uses: actions/checkout@v4
51+
with:
52+
repository: bec/{{ project_name }}
53+
ref: "{% raw %}${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}{% endraw %}"
54+
path: ./{{ project_name }}
55+
56+
- name: Lint for merge conflicts
57+
run: |
58+
59+
4960
- name: Checkout BEC Core
5061
uses: actions/checkout@v4
5162
with:
@@ -67,13 +78,6 @@ jobs:
6778
ref: "{% raw %}${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}{% endraw %}"
6879
path: ./bec_widgets
6980

70-
- name: Checkout BEC Plugin Repository
71-
uses: actions/checkout@v4
72-
with:
73-
repository: bec/{{ project_name }}
74-
ref: "{% raw %}${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}{% endraw %}"
75-
path: ./{{ project_name }}
76-
7781
- name: Install dependencies
7882
shell: bash
7983
run: |
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create template upgrade PR for {{ project_name }}
2+
on:
3+
workflow_dispatch:
4+
5+
permissions:
6+
pull-requests: write
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Setup Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
18+
- name: Install tools
19+
run: |
20+
pip install copier
21+
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Perform update
26+
run: |
27+
branch="chore/update-template-$(python -m uuid)"
28+
git checkout -b $branch
29+
msg = $(copier update --trust --defaults --conflict inline 2>&1 | sed -n 1p)
30+
git add -A
31+
git diff-index --quiet HEAD || git commit -a -m $msg
32+
git push -u origin $branch

0 commit comments

Comments
 (0)