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

[BEAM-3255] Enabling gradle-based release process #5187

Merged
merged 2 commits into from
Apr 25, 2018

Conversation

pabloem
Copy link
Member

@pabloem pabloem commented Apr 19, 2018

This creates a release task that emulates the workflow to create release candidates. The workflow for this is as follows:

# Create environment variables. Supposing that we're preparing the 2.5.0 release:
RELEASE=2.5.0
NEXT_VERSION=2.6.0
CANDIDATE=1
BRANCH=release-${RELEASE}

# Create a release branch
git branch ${BRANCH}

# Now change the version in existing gradle files, and Python files
sed -i 's/'$RELEASE'/'${NEXT_VERSION}'/g' build_rules.gradle
sed -i 's/'$RELEASE'/'${NEXT_VERSION}'/g' gradle.properties
sed -i 's/'$RELEASE'/'${NEXT_VERSION}'/g' sdks/python/apache_beam/version.py

# Save changes in master branch
git add gradle.properties build_rules.gradle sdks/python/apache_beam/version.py
git commit -m "Moving to ${NEXT_VERSION}-SNAPSHOT on master branch."

# RELEASE TASK
# In the release branch, run the release task
git checkout ${BRANCH}
./gradlew release -Prelease.newVersion=${RELEASE}-SNAPSHOT \
                  -Prelease.releaseVersion=${RELEASE}-RC${CANDIDATE} \
                  -Prelease.useAutomaticVersion=true --info --no-daemon

The release task must be performed each time a new Release Candidate is created, and once one is approved, then it's just necessary to add a new tag for the release:

git tag ${RELEASE} ${RELEASE}-RC${CANDIDATE}

The release task does the following:

  • Checks that no commits / updates are needed to the code
  • Checks that project has no SNAPSHOT dependencies
  • Runs build
  • Changes version in gradle.properties to remove -SNAPSHOT
  • Performs a commit
  • Adds a tag like so: v${RELEASE}-RC${CANDIDATE}
  • Changes version in gradle.properties back to contain -SNAPSHOT
  • Performs a commit

@pabloem
Copy link
Member Author

pabloem commented Apr 19, 2018

This task is based on using the https://github.com/researchgate/gradle-release#introduction gradle plugin

@pabloem
Copy link
Member Author

pabloem commented Apr 25, 2018

Retest this please.

@aaltay aaltay merged commit b195516 into apache:master Apr 25, 2018
@pabloem pabloem deleted the gradle-release-branch branch April 25, 2018 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants