-
Notifications
You must be signed in to change notification settings - Fork 24
build: share releases of feature tags for install from pull requests #125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,7 +33,7 @@ commands: | |
| - run: | ||
| name: Output BUILD_VERSION env var based on recent git tag and type of build | ||
| command: | | ||
| BUILD_VERSION=$(git describe --tags --match 'v*.*.*' --exclude '*feature'); | ||
| BUILD_VERSION=$(git describe --tags --match 'v*.*.*'); | ||
| echo "git tag-based BUILD_VERSION: $BUILD_VERSION" | ||
| if [[ "<< parameters.release_ref >>" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | ||
| # if release tag starts with semver, then this is either a prod or feature build. use the release tag, then, as build version too. | ||
|
|
@@ -470,12 +470,10 @@ jobs: | |
| export JOB_PARAMS=$( | ||
| jq -n \ | ||
| --arg j S3_UPLOAD \ | ||
| --arg ct "$CIRCLE_TAG" \ | ||
| --arg cs "$CIRCLE_SHA1" \ | ||
|
Comment on lines
-473
to
-474
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. πͺ These are unused in the upstream script!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, thanks for removing them and simplifying the config! |
||
| --arg ad << parameters.artifact_dir >> \ | ||
| --arg p << parameters.s3-target-path >> \ | ||
| --arg fn << parameters.file-name >> \ | ||
| '{JOB_NAME: $j, ARTIFACTS_DIR: $ad, CIRCLE_TAG: $ct, CIRCLE_SHA1: $cs, S3_TARGET_PATH: $p, FILE_NAME: $fn}' | ||
| '{JOB_NAME: $j, ARTIFACTS_DIR: $ad, S3_TARGET_PATH: $p, FILE_NAME: $fn}' | ||
| ) | ||
| if [ -n "${CIRCLE_TAG}" ]; then export GIT_REF=$CIRCLE_TAG; else export GIT_REF=$CIRCLE_BRANCH; fi | ||
| sudo /Library/circleci/runner-entrypoint.sh $GIT_REF "$JOB_PARAMS" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ guide is **not** for you. You can of course keep reading though. | |
| - [Tools](#tools): the development tooling for this codebase | ||
| - [Project layout](#project-layout): an overview of project directories | ||
| - [Tasks](#tasks): common things done during development | ||
| - [Development build](#development-build): for releases with the latest changes | ||
| - [Releases](#releases): when releasing the latest changes | ||
| - [Workflow](#workflow): around changes and contributions | ||
| - [Everything else](#everything-else): and all of those other things | ||
|
|
||
|
|
@@ -622,14 +622,22 @@ Slack CLI: | |
| - slack.com | ||
| - slackb.com | ||
|
|
||
| ## Development build | ||
| ## Releases | ||
|
|
||
| On regular occasion and a recurring schedule the latest changes are tagged for | ||
| release. | ||
|
|
||
| - [Development build](#development-build) | ||
| - [Feature tag](#feature-tags) | ||
|
|
||
| ### Development build | ||
|
|
||
| The development build comes in 2 flavours: | ||
|
|
||
| 1. Development build GitHub release | ||
| 2. Development build install script | ||
|
|
||
| ### 1. Development build GitHub release | ||
| #### 1. Development build GitHub release | ||
|
|
||
| A development build and recent changelog is generated each night from `main` | ||
| with all of the latest changes. Builds are released with the `dev-build` tag and | ||
|
|
@@ -646,7 +654,7 @@ Each release page contains: | |
| The development build and release automation is performed from the `deploy-dev` | ||
| job in the [`.circleci/config.yml`][circleci] file. | ||
|
|
||
| ### 2. Development build install script | ||
| #### 2. Development build install script | ||
|
|
||
| An installation script for the development build provides the same `dev-build` | ||
| release tag but with magic setup: | ||
|
|
@@ -659,6 +667,24 @@ Changes to the actual installation scripts are made through other channels and | |
| might become outdated between releases. These scripts can still be found in the | ||
| [`scripts/`][scripts] directory in the meantime. | ||
|
|
||
| ### Feature tags | ||
|
|
||
| Unreleased changes that haven't landed on `main` can be shared and installed | ||
| using feature tags. | ||
|
|
||
| Create a new tag in the following format on a branch of a pull request: | ||
|
|
||
| ```bash | ||
| git tag v3.4.5-[example-branch-name]-feature # Replace with the branch | ||
| git push origin v3.4.5-feat-something-feature # Start the build on push | ||
| ``` | ||
|
|
||
| After a few minutes these changes can be installed using the install script: | ||
|
|
||
| ```bash | ||
| curl -fsSL https://downloads.slack-edge.com/slack-cli/install-dev.sh | bash -s -- -v 3.4.5-feat-something-feature | ||
| ``` | ||
|
Comment on lines
+684
to
+686
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahhhh, so nice to have this documented! β¨ |
||
|
|
||
| ## Workflow | ||
|
|
||
| ### Fork | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,18 @@ jobs: | |
| echo "Failed to find $TAG_NAME, trying next..." | ||
| fi | ||
| sleep 1 | ||
|
|
||
| FEATURE_TAG_NAME="${TAGS}-${REF}-feature" | ||
| echo "Identified feature-release tagname as πͺ: $FEATURE_TAG_NAME" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. πͺ Here we attempt to delete feature releases after the corresponding PR merges into I'm not certain if we want to do this or if it should set
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can see both sides of the question. On one side, the feature release might be useful to folks even if it's merged and released. For example, falling back on a working feature build that has a bug in the production release. On the other hand, cleaning up development work (including feature tags) would be nice. |
||
|
|
||
| # Delete a feature-release | ||
| if GH_DEBUG=1 gh release --repo="slackapi/slack-cli" delete "$FEATURE_TAG_NAME" -y --cleanup-tag; then | ||
| echo "Successfully deleted $FEATURE_TAG_NAME" | ||
| RELEASE_FOUND=0 | ||
| else | ||
| echo "Failed to find $FEATURE_TAG_NAME, trying next..." | ||
| fi | ||
| sleep 1 | ||
| done | ||
| if [ "$RELEASE_FOUND" -ne 0 ]; then | ||
| echo "No matching pre-releases tag was found for the branch $TAG_NAME in recent versions" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ποΈβπ¨οΈ Accepting the
-featuresuffix matches the description of collecting the build version, and matches the tag thatgoreleaserexpects:slack-cli/.circleci/config.yml
Line 23 in 12daa9a