Skip to content

Commit

Permalink
🔥 Remove CI autoversioning
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jan 15, 2024
1 parent 07e3e4a commit c4f2873
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 187 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 0 additions & 30 deletions dev/circleci_data/drop_version_bump_commits

This file was deleted.

9 changes: 0 additions & 9 deletions dev/circleci_data/drop_version_commits_back_to

This file was deleted.

81 changes: 0 additions & 81 deletions dev/circleci_data/override_version_tag_list

This file was deleted.

16 changes: 0 additions & 16 deletions dev/circleci_data/prep_merge

This file was deleted.

0 comments on commit c4f2873

Please sign in to comment.