|
35 | 35 | uses: actions/checkout@v3 |
36 | 36 | with: |
37 | 37 | fetch-depth: 2 |
38 | | - - uses: actions/setup-python@v4 |
39 | | - with: |
40 | | - python-version: '3.9' |
41 | | - cache: 'pip' |
42 | | - - name: Check if version updated |
43 | | - id: version_updated |
44 | | - run: | |
45 | | - git config --global user.email "[email protected]" |
46 | | - git config --global user.name "Theodore (Machine User)" |
47 | | - GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-) |
48 | | - export PYTHONPATH=$PWD |
49 | | - pip install -q wheel |
50 | | - pip install -q nipype numpy matplotlib pandas pathvalidate pytz pyyaml voluptuous |
51 | | - python ./CPAC/utils/configuration/yaml_template.py |
52 | | - if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] |
53 | | - then |
54 | | - git add CPAC/resources/configs |
55 | | - git commit -m ":bulb: Update comments based on default preconfig" |
56 | | - fi |
57 | | - COMMIT_MESSAGE=$(git log -1 --pretty=%B) |
58 | | - if [[ ! "$COMMIT_MESSAGE" == *"Update version to"* ]] |
59 | | - then |
60 | | - cd CPAC |
61 | | - VERSION=$(python -c "from info import __version__; print(('.'.join(('.'.join(__version__[::-1].split('-')[1].split('.')[1:])[::-1], __version__.split('-')[1])) if '-' in __version__ else __version__).split('+', 1)[0])") |
62 | | - cd .. |
63 | | - echo "v${VERSION}" > version |
64 | | - find ./CPAC/resources/configs -name "*.yml" -exec sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" {} \; |
65 | | - git add version |
66 | | - VERSIONS=($(git diff origin/${GITHUB_BRANCH} -- version | tail -n 2)) |
67 | | - export PATTERN="(declare|typeset) -a" |
68 | | - if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]] |
69 | | - then |
70 | | - for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile") |
71 | | - do |
72 | | - export IFS="" |
73 | | - for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]:1}" ${DOCKERFILE}) |
74 | | - do |
75 | | - echo "Updating stage tags in ${DOCKERFILE}" |
76 | | - sed -i "s/\-${VERSIONS[0]:1}/\-${VERSIONS[1]:1}/g" ${DOCKERFILE} |
77 | | - done |
78 | | - done |
79 | | - unset IFS |
80 | | - fi |
81 | | - if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] |
82 | | - then |
83 | | - git add CPAC/resources/configs .github/Dockerfiles |
84 | | - git commit -m ":bookmark: Update version to ${VERSION} ($COMMIT_MESSAGE)" || true |
85 | | - git push origin HEAD:${GITHUB_BRANCH} || true |
86 | | - fi |
87 | | - cd .. |
88 | | - fi |
89 | | - if [[ "${GITHUB_REF_TYPE}" == "tag" ]] |
90 | | - then |
91 | | - cd $HOME/work/C-PAC/C-PAC |
92 | | - for DOCKERFILE in $(ls .github/Dockerfiles/C-PAC.develop-*.Dockerfile) |
93 | | - do |
94 | | - if [[ "$DOCKERFILE" =~ .*C-PAC.develop-(.*)-(bionic|xenial).Dockerfile ]] |
95 | | - then |
96 | | - cp $DOCKERFILE variant-${BASH_REMATCH[1]}.Dockerfile |
97 | | - else |
98 | | - cp $DOCKERFILE Dockerfile |
99 | | - fi |
100 | | - done |
101 | | - git add *ockerfile |
102 | | - git commit -m ":truck: Copy develop Dockerfiles to root directory \ |
103 | | - \ |
104 | | - [skip ci]" |
105 | | - git push origin HEAD:${GITHUB_BRANCH} || true |
106 | | - fi |
107 | 38 | - name: Get changed files since last commit |
108 | | - uses: tj-actions/changed-files@v35.7.6 |
| 39 | + uses: tj-actions/changed-files@v41.0.0 |
109 | 40 | id: changed-files |
110 | 41 | with: |
111 | 42 | since_last_remote_commit: "true" |
|
0 commit comments