Skip to content

Commit

Permalink
Revert "ci: fix pre-release and tagged release (#313)"
Browse files Browse the repository at this point in the history
This reverts commit 9893c5d.
  • Loading branch information
dpilch authored and alharris-at committed Feb 25, 2022
1 parent 291e86f commit 565e7e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
30 changes: 4 additions & 26 deletions .circleci/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,10 @@ if [[ `git log --format=%s -n 1` =~ ^chore\(release\):\ v.* ]]; then
# production release
npx lerna publish from-git --ignore-scripts -y;
else
SHORT_SHA1=$(echo $CIRCLE_SHA1 | cut -c -7)

# pre-release or tagged release
# if branch starts with tagged-release/ then do tagged release, else pre-release
if [[ $CIRCLE_BRANCH =~ ^tagged-release\/.* ]]; then
TAGGED_RELEASE_NAME=$(echo $CIRCLE_BRANCH | sed 's:.*/::')
npx lerna version prerelease \
--amend \
--ignore-scripts \
--no-commit-hooks \
--preid ${TAGGED_RELEASE_NAME}-${SHORT_SHA1} \
-y
npx lerna publish from-git \
--ignore-scripts \
--pre-dist-tag $TAGGED_RELEASE_NAME \
-y;
else
npx lerna version prerelease \
--amend \
--ignore-scripts \
--no-commit-hooks \
--preid $SHORT_SHA1 \
-y
npx lerna publish from-git \
--ignore-scripts \
--pre-dist-tag next \
-y;
fi;
npx lerna publish --canary --ignore-scripts -y \
--preid $([[ $CIRCLE_BRANCH =~ ^tagged-release\/.* ]] \
&& echo $(echo $CIRCLE_BRANCH | sed 's:.*/::') --no-pre-dist-tag \
|| echo alpha --pre-dist-tag next);
fi
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,20 @@ Studio UI does not yet consume Codegen UI from NPM and instead the Codegen UI so

A pre-release is automatically published to NPM when the following cirteria are met:

- A commit is pushed to then `main` or `develop` branch.
- A commit is pushed to then `main` branch.
- The commit is not a release commit (i.e. `chore(release): v...`).
- The commit has changes to a leaf package source.
- Ex. updating `.circleci/config.yml` will not make a pre-release, but changes `packages/codegen-ui/lib/studio-node.ts` will.
- Lerna will only look back a single commit. If the HEAD commit does not meet previous cirteria the pre-release will not be published.

The pre-release will increment the patch version of each package and append meta information including the short commit hash.
These changes will **NOT** be pushed back to the GitHub repo.

Example:

```
- @aws-amplify/codegen-ui-react => 1.1.1-2baaca9.0
- @aws-amplify/codegen-ui => 1.1.1-2baaca9.0
- @aws-amplify/codegen-ui-react => 1.1.1-alpha.270+2baaca9
- @aws-amplify/codegen-ui => 1.1.1-alpha.270+2baaca9
```

The pre-release will be published under the `next` dist tag.
Expand All @@ -154,8 +157,8 @@ To create a tagged release create a pull request or push directly to a branch wi
The branch name must not contain any additional forward slashes after `tagged-release/`.
The tagged release will use the same versioning process as the pre-release except:

- the preid will inlcude the branch name with `tagged-release/` removed. (Ex. `1.1.1-fix-properties-2baaca9.0`)
- the release will be published with the dist tag as the tagged release name. (Ex. `fix-properties`)
- the preid will be the branch name with `tagged-release/` removed. (Ex. `1.1.1-fix-properties.270+2baaca9`)
- the release will not be published under any dist tag

### Icons

Expand Down

0 comments on commit 565e7e9

Please sign in to comment.