-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathrelease
executable file
·33 lines (25 loc) · 955 Bytes
/
release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/env bash
tag=$1
## If no tag is provided, default to latest
if [ -z "$tag" ]; then
tag="nightly"
fi
if [ "$tag" != "latest" ] && [ "$tag" != "nightly" ] && [ "$tag" != "experimental" ]; then
echo "Error: tag must be one of: latest, nightly, experimental"
exit 1
fi
if [ "$tag" = "experimental" ]; then
# Only for experimental releases, force an empty changeset to ensure a build is created
echo -e "---\n'"'@shopify/cli'"': patch\n---" > .changeset/force-experimental-build.md
fi
# Only for nightly and experimental releases, set the snapshot version
if [ "$tag" = "nightly" ] || [ "$tag" = "experimental" ]; then
pnpm changeset version --snapshot $tag
./bin/update-cli-kit-version.js
fi
# Bundle the packages
pnpm bundle-for-release
# Create a duplicate package for the CLI (to be deployed as just `shopify`)
node bin/create-cli-duplicate-package.js
# Publish the packages
pnpm changeset publish --tag $tag --no-git-tag