-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
0 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,57 +35,6 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' | ||
- name: Check if version updated | ||
id: version_updated | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Theodore (Machine User)" | ||
GITHUB_BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-) | ||
export PYTHONPATH=$PWD | ||
pip install -q wheel | ||
pip install -q nipype numpy matplotlib pandas pathvalidate pytz pyyaml voluptuous | ||
python ./CPAC/utils/configuration/yaml_template.py | ||
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] | ||
then | ||
git add CPAC/resources/configs | ||
git commit -m ":bulb: Update comments based on default preconfig" | ||
fi | ||
COMMIT_MESSAGE=$(git log -1 --pretty=%B) | ||
if [[ ! "$COMMIT_MESSAGE" == *"Update version to"* ]] | ||
then | ||
cd CPAC | ||
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])") | ||
cd .. | ||
echo "v${VERSION}" > version | ||
find ./CPAC/resources/configs -name "*.yml" -exec sed -i -r "s/^(# [Vv]ersion ).*$/# Version ${VERSION}/g" {} \; | ||
git add version | ||
VERSIONS=($(git diff origin/${GITHUB_BRANCH} -- version | tail -n 2)) | ||
export PATTERN="(declare|typeset) -a" | ||
if [[ "$(declare -p VERSIONS)" =~ $PATTERN ]] | ||
then | ||
for DOCKERFILE in $(find ./.github/Dockerfiles -name "*.Dockerfile") | ||
do | ||
export IFS="" | ||
for LINE in $(grep "FROM ghcr\.io/fcp\-indi/c\-pac/.*\-${VERSIONS[0]:1}" ${DOCKERFILE}) | ||
do | ||
echo "Updating stage tags in ${DOCKERFILE}" | ||
sed -i "s/\-${VERSIONS[0]:1}/\-${VERSIONS[1]:1}/g" ${DOCKERFILE} | ||
done | ||
done | ||
unset IFS | ||
fi | ||
if [[ ! -z $(git diff origin/${GITHUB_BRANCH}) ]] | ||
then | ||
git add CPAC/resources/configs .github/Dockerfiles | ||
git commit -m ":bookmark: Update version to ${VERSION} ($COMMIT_MESSAGE)" || true | ||
git push origin HEAD:${GITHUB_BRANCH} || true | ||
fi | ||
cd .. | ||
fi | ||
- name: Get changed files since last commit | ||
uses: tj-actions/[email protected] | ||
id: changed-files | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.