Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Copy link
Member Author

Choose a reason for hiding this comment

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

πŸ‘οΈβ€πŸ—¨οΈ Accepting the -feature suffix matches the description of collecting the build version, and matches the tag that goreleaser expects:

description: "Exports a BUILD_VERSION env var based on the most recent git tag. The format of the string will be 'vX.X.X[-branch-name[-feature]]', unless the `sanitized` parameter is set to `true` which drops the `v` prefix."

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.
Expand Down Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

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

πŸͺ“ These are unused in the upstream script!

Copy link
Member

Choose a reason for hiding this comment

The 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"
Expand Down
34 changes: 30 additions & 4 deletions .github/MAINTAINERS_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

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

Ahhhh, so nice to have this documented! ✨


## Workflow

### Fork
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/delete-pr-build-on-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The 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 main with the feature branch deleted to prefer the "dev" build.

I'm not certain if we want to do this or if it should set RELEASE_FOUND to "0" πŸ€”

Copy link
Member

Choose a reason for hiding this comment

The 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"
Expand Down
Loading