Skip to content

Commit c64e342

Browse files
authored
build: share releases of feature tags for install from pull requests (#125)
1 parent 50e8223 commit c64e342

3 files changed

Lines changed: 44 additions & 8 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ commands:
3333
- run:
3434
name: Output BUILD_VERSION env var based on recent git tag and type of build
3535
command: |
36-
BUILD_VERSION=$(git describe --tags --match 'v*.*.*' --exclude '*feature');
36+
BUILD_VERSION=$(git describe --tags --match 'v*.*.*');
3737
echo "git tag-based BUILD_VERSION: $BUILD_VERSION"
3838
if [[ "<< parameters.release_ref >>" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
3939
# 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:
470470
export JOB_PARAMS=$(
471471
jq -n \
472472
--arg j S3_UPLOAD \
473-
--arg ct "$CIRCLE_TAG" \
474-
--arg cs "$CIRCLE_SHA1" \
475473
--arg ad << parameters.artifact_dir >> \
476474
--arg p << parameters.s3-target-path >> \
477475
--arg fn << parameters.file-name >> \
478-
'{JOB_NAME: $j, ARTIFACTS_DIR: $ad, CIRCLE_TAG: $ct, CIRCLE_SHA1: $cs, S3_TARGET_PATH: $p, FILE_NAME: $fn}'
476+
'{JOB_NAME: $j, ARTIFACTS_DIR: $ad, S3_TARGET_PATH: $p, FILE_NAME: $fn}'
479477
)
480478
if [ -n "${CIRCLE_TAG}" ]; then export GIT_REF=$CIRCLE_TAG; else export GIT_REF=$CIRCLE_BRANCH; fi
481479
sudo /Library/circleci/runner-entrypoint.sh $GIT_REF "$JOB_PARAMS"

.github/MAINTAINERS_GUIDE.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ guide is **not** for you. You can of course keep reading though.
1010
- [Tools](#tools): the development tooling for this codebase
1111
- [Project layout](#project-layout): an overview of project directories
1212
- [Tasks](#tasks): common things done during development
13-
- [Development build](#development-build): for releases with the latest changes
13+
- [Releases](#releases): when releasing the latest changes
1414
- [Workflow](#workflow): around changes and contributions
1515
- [Everything else](#everything-else): and all of those other things
1616

@@ -622,14 +622,22 @@ Slack CLI:
622622
- slack.com
623623
- slackb.com
624624

625-
## Development build
625+
## Releases
626+
627+
On regular occasion and a recurring schedule the latest changes are tagged for
628+
release.
629+
630+
- [Development build](#development-build)
631+
- [Feature tag](#feature-tags)
632+
633+
### Development build
626634

627635
The development build comes in 2 flavours:
628636

629637
1. Development build GitHub release
630638
2. Development build install script
631639

632-
### 1. Development build GitHub release
640+
#### 1. Development build GitHub release
633641

634642
A development build and recent changelog is generated each night from `main`
635643
with all of the latest changes. Builds are released with the `dev-build` tag and
@@ -646,7 +654,7 @@ Each release page contains:
646654
The development build and release automation is performed from the `deploy-dev`
647655
job in the [`.circleci/config.yml`][circleci] file.
648656

649-
### 2. Development build install script
657+
#### 2. Development build install script
650658

651659
An installation script for the development build provides the same `dev-build`
652660
release tag but with magic setup:
@@ -659,6 +667,24 @@ Changes to the actual installation scripts are made through other channels and
659667
might become outdated between releases. These scripts can still be found in the
660668
[`scripts/`][scripts] directory in the meantime.
661669

670+
### Feature tags
671+
672+
Unreleased changes that haven't landed on `main` can be shared and installed
673+
using feature tags.
674+
675+
Create a new tag in the following format on a branch of a pull request:
676+
677+
```bash
678+
git tag v3.4.5-[example-branch-name]-feature # Replace with the branch
679+
git push origin v3.4.5-feat-something-feature # Start the build on push
680+
```
681+
682+
After a few minutes these changes can be installed using the install script:
683+
684+
```bash
685+
curl -fsSL https://downloads.slack-edge.com/slack-cli/install-dev.sh | bash -s -- -v 3.4.5-feat-something-feature
686+
```
687+
662688
## Workflow
663689

664690
### Fork

.github/workflows/delete-pr-build-on-close.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ jobs:
6565
echo "Failed to find $TAG_NAME, trying next..."
6666
fi
6767
sleep 1
68+
69+
FEATURE_TAG_NAME="${TAGS}-${REF}-feature"
70+
echo "Identified feature-release tagname as 🔪: $FEATURE_TAG_NAME"
71+
72+
# Delete a feature-release
73+
if GH_DEBUG=1 gh release --repo="slackapi/slack-cli" delete "$FEATURE_TAG_NAME" -y --cleanup-tag; then
74+
echo "Successfully deleted $FEATURE_TAG_NAME"
75+
RELEASE_FOUND=0
76+
else
77+
echo "Failed to find $FEATURE_TAG_NAME, trying next..."
78+
fi
79+
sleep 1
6880
done
6981
if [ "$RELEASE_FOUND" -ne 0 ]; then
7082
echo "No matching pre-releases tag was found for the branch $TAG_NAME in recent versions"

0 commit comments

Comments
 (0)