-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (54 loc) · 1.74 KB
/
build.yml
File metadata and controls
62 lines (54 loc) · 1.74 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
# MIT licensed
name: openMINDS_java_build_pipeline
on:
push:
branches:
- pipeline
workflow_dispatch: # This triggers the workflow when a webhook is received
inputs:
branch:
description: 'The branch of the submodule the workflow was triggered for'
required: true
type: string
repository:
description: 'The repository of the submodule the workflow was triggered for'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Run build
run: |
pip install -r requirements.txt
python build.py
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main
path: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push to main
run: |
rsync -a --delete --exclude 'img/' --exclude 'pom.xml' --exclude 'README*' --exclude 'LICENSE' target/ main/
cd main
rm -rf build openMINDS.egg-info
git config --global user.email "openminds@ebrains.eu"
git config --global user.name "openMINDS pipeline"
if [[ $(git add -A --dry-run | wc -l) -gt 0 ]]; then
git add -A
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
git commit -m "build triggered by submodule ${{ inputs.repository }} version ${{ inputs.branch }}"
else
git commit -m "build triggered by ${{ github.event_name }}"
fi
git push -f
else
echo "Nothing to commit"
fi