Skip to content

Commit

Permalink
chore(turbo-ignore): update release flow (vercel#3421)
Browse files Browse the repository at this point in the history
Pull turbo-ignore into the standard release flow
  • Loading branch information
tknickman authored Jan 23, 2023
1 parent 4eb66af commit 3edef0f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 69 deletions.
9 changes: 1 addition & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,7 @@ If you're using a different package manager replace npm accordingly.

## Publishing `turbo` to the npm registry

All builds are handled by manually triggering the appropriate [`release` GitHub workflow](./.github/workflows/release.yml).

To manually run a release:

1. `brew install goreleaser`
2. Add `GORELEASER_KEY` env var with the GoReleaser Pro key (ask @turbo-oss to get access to the key)
3. Update `version.txt` (do not commit this change to git manually)
4. `cd cli && make publish`
See [the publishing guide](./release.md#release-turborepo).

## Contributing to Turbopack

Expand Down
49 changes: 2 additions & 47 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ build-go-turbo-cross:
build-lib-turbo-cross:
goreleaser release --rm-dist -f cross-lib.yml


.PHONY: stage-release
stage-release: cmd/turbo/version.go
echo "Version: $(TURBO_VERSION)"
Expand All @@ -162,52 +161,6 @@ stage-release: cmd/turbo/version.go
git tag "v$(TURBO_VERSION)"
git push origin staging-$(TURBO_VERSION) --tags --force

.PHONY: publish
publish: clean build
echo "Version: $(TURBO_VERSION)"
echo "Tag: $(TURBO_TAG)"

# Include the patch in the log.
git format-patch HEAD~1 --stdout | cat

npm config set --location=project "//registry.npmjs.org/:_authToken" $(NPM_TOKEN)

# Publishes the native npm modules.
goreleaser release --rm-dist -f combined-release.yml

# Split packing from the publish step so that pnpm locates the correct .npmrc file.
cd $(CLI_DIR)/../packages/turbo && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/turbo-ignore && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/create-turbo && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/turbo-codemod && pnpm pack --pack-destination=$(CLI_DIR)/../

# Publish the remaining JS packages in order to avoid race conditions.
cd $(CLI_DIR)/../
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-$(TURBO_VERSION).tgz
# npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-ignore-$(TURBO_VERSION).tgz
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../create-turbo-$(TURBO_VERSION).tgz
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-codemod-$(TURBO_VERSION).tgz

.PHONY: snapshot-turbo
snapshot-turbo:
echo "Version: $(TURBO_VERSION)"
echo "Tag: $(TURBO_TAG)"

# Include the patch in the log.
git format-patch HEAD~1 --stdout | cat

npm config set --location=project "//registry.npmjs.org/:_authToken" $(NPM_TOKEN)

# Publishes the native npm modules.
goreleaser release --rm-dist -f combined-shim.yml --snapshot

# Split packing from the publish step so that npm locates the correct .npmrc file.
cd $(CLI_DIR)/../packages/turbo && pnpm pack --pack-destination=$(CLI_DIR)/dist/
cd $(CLI_DIR)/../packages/turbo-ignore && pnpm pack --pack-destination=$(CLI_DIR)/dist/
cd $(CLI_DIR)/../packages/create-turbo && pnpm pack --pack-destination=$(CLI_DIR)/dist/
cd $(CLI_DIR)/../packages/turbo-codemod && pnpm pack --pack-destination=$(CLI_DIR)/dist/


.PHONY: publish-turbo
publish-turbo: clean build
echo "Version: $(TURBO_VERSION)"
Expand All @@ -225,12 +178,14 @@ publish-turbo: clean build
cd $(CLI_DIR)/../packages/turbo && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/create-turbo && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/turbo-codemod && pnpm pack --pack-destination=$(CLI_DIR)/../
cd $(CLI_DIR)/../packages/turbo-ignore && pnpm pack --pack-destination=$(CLI_DIR)/../

# Publish the remaining JS packages in order to avoid race conditions.
cd $(CLI_DIR)/../
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-$(TURBO_VERSION).tgz
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../create-turbo-$(TURBO_VERSION).tgz
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-codemod-$(TURBO_VERSION).tgz
npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-ignore-$(TURBO_VERSION).tgz

demo/lage: install
node $(CLI_DIR)/scripts/generate.mjs lage
Expand Down
1 change: 0 additions & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"test": "make test-go",
"e2e": "make e2e",
"e2e-prebuilt": "make e2e-prebuilt",
"publish": "make publish-all",
"format": "make fmt-go",
"lint": "make lint-go",
"integration-tests": "make integration-tests"
Expand Down
6 changes: 0 additions & 6 deletions packages/turbo-ignore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ When deploying on [Vercel](https://vercel.com), `turbo-ignore` can make a more a
**NOTE:** By default on Vercel, `turbo-ignore` will always deploy the first commit of a new branch. This behavior can be changed by providing the `ref` to compare against to the `--fallback` flag. See the [Examples](#Examples) section for more details.
## Releasing
```sh
pnpm release
```
---
For more information about Turborepo, visit [turbo.build](https://turbo.build) and follow us on Twitter ([@turborepo](https://twitter.com/turborepo))!
11 changes: 6 additions & 5 deletions packages/turbo-ignore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
"bugs": {
"url": "https://github.com/vercel/turbo/issues"
},
"main": "index.js",
"bin": "index.js",
"files": [
"dist"
],
"main": "dist/index.js",
"bin": "dist/index.js",
"scripts": {
"build": "tsup && cp ./package.json ./dist/package.json && cp README.md ./dist/README.md",
"release": "pnpm build && cd dist && pnpm publish",
"build": "tsup",
"test": "jest",
"lint": "eslint src/**/*.ts",
"check-types": "tsc --noEmit"
},
"devDependencies": {
"@manypkg/find-root": "^1.1.0",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.12",
"eslint": "^8.20.0",
Expand Down
2 changes: 0 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3edef0f

Please sign in to comment.