Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Use src/VERSION for maintenance build on release branch #11522

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,25 @@ jobs:
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run: |
cd /tmp/workspace/distribution-scripts
case "$CIRCLE_BRANCH" in
release/*)
# In release branches, always use version from src/VERSION
VERSION=$(cat src/VERSION)
;;
*)
# The version is based on the branch name.
VERSION=$CIRCLE_BRANCH

# We need to sanitize it because there are restrictions on some places
# where the version is use (Mac pkg names, snap branch).
VERSION=${VERSION//_/-}
VERSION=${VERSION//\//-}-dev
Comment on lines +222 to +225
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be applied unconditionally I guess (to be on the safe side).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figure if src/VERSION has underscores or slashes, we're in more trouble anyways. So this isn't technically necessary.

;;
esac

# The version is based on the branch name.
VERSION=$CIRCLE_BRANCH

# We need to sanitize it because there are restrictions on some places
# where the version is use (Mac pkg names, snap branch).
VERSION=${VERSION/release\//}
VERSION=${VERSION//_/-}
VERSION=${VERSION//\//-}-dev
cd /tmp/workspace/distribution-scripts

export VERSION
echo "export CRYSTAL_VERSION=$VERSION" >> build.env
Expand Down