[ci build] update cmake #171
Workflow file for this run
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
# -*- mode: yaml -*- | |
name: Tag new version, update eman-feedstock | |
#name: Automated Version Bumping | |
on: | |
push: | |
# branches: | |
# - master | |
jobs: | |
bump-and-tag: | |
# push-to-eman-feedstock: | |
# bump-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Parse commit message for bump type | |
run: | | |
if ${{ contains(github.event.head_commit.message, '[bump patch]') || contains(github.event.head_commit.message, '[ci build]') }}; then | |
echo "bump=patch" >> $GITHUB_ENV | |
elif ${{ contains(github.event.head_commit.message, '[bump minor]') }}; then | |
echo "bump=minor" >> $GITHUB_ENV | |
elif ${{ contains(github.event.head_commit.message, '[bump major]') }}; then | |
echo "bump=major" >> $GITHUB_ENV | |
else | |
echo "No version bump requested. Exiting workflow." | |
exit 0 | |
fi | |
- name: Checkout eman2 | |
if: ${{ env.bump }} | |
uses: actions/checkout@v2 | |
# - name: Set up Git user | |
# if: ${{ env.bump }} | |
# run: | | |
# git config --global user.email "eman.github@gmail.com" | |
# git config --global user.name "eman-bot" | |
- name: Bump and tag new version | |
if: ${{ env.bump }} | |
run: | | |
version="v2.99.56" | |
echo "Current version: ${version}" | |
echo "Requested bump: ${{ env.bump }}" | |
if [[ "$version" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | |
major="${BASH_REMATCH[1]}" | |
minor="${BASH_REMATCH[2]}" | |
patch="${BASH_REMATCH[3]}" | |
fi | |
case "${{ env.bump }}" in | |
major) | |
major=$((major + 1)) | |
minor=0 | |
patch=0 | |
;; | |
minor) | |
minor=$((minor + 1)) | |
patch=0 | |
;; | |
patch) | |
patch=$((patch + 1)) | |
;; | |
*) | |
echo "Unknown bump type: ${{ env.bump }}" | |
exit 1 | |
;; | |
esac | |
new_version="v${major}.${minor}.${patch}" | |
echo ${new_version} | |
echo "new_version=${new_version}" >> $GITHUB_ENV | |
sed -i 's/VERSION\s*"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*/VERSION ${new_version}/' CMakeLists.txt | |
git status | |
git diff HEAD | |
head CMakeLists.txt | |
- name: Checkout eman-feedstock | |
if: ${{ env.bump }} | |
uses: actions/checkout@v2 | |
with: | |
repository: cryoem/eman-feedstock | |
# token: ${{ secrets.PAT }} | |
# | |
- name: Update version and build in eman-feedstock | |
if: ${{ env.bump }} | |
run: | | |
echo "recipe/meta.yaml Before" | |
cat recipe/meta.yaml | |
sed -i 's/set\s*version\s*=\s*"[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*"/set version = "${{ env.new_version }}"/' recipe/meta.yaml | |
sed -i 's/set\s*build\s*=\s*[0-9][0-9]*/set build = 0/' recipe/meta.yaml | |
echo;echo;echo;echo;echo; | |
echo "recipe/meta.yaml After" | |
cat recipe/meta.yaml | |
# git add recipe/meta.yaml | |
# git commit -m "Bump version to ${{ env.new_version }}" | |
# git push origin master |