Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(release): remove goreleaser #9905

Merged
merged 6 commits into from
Feb 6, 2025

Conversation

chris-olszewski
Copy link
Member

@chris-olszewski chris-olszewski commented Feb 5, 2025

Description

Finally remove goreleaser after Go left the codebase a year ago. This does almost exactly what we were doing with goreleaser except we now base the native releases off of version.txt contents like every other package and not Git tags.

I highly recommend reading each commit especially the first one as I mark up the goreleaser flow we were using explaining what exactly it did.

Testing Instructions

The dry run got up to the publishing step! All of the tar.gz files look correct: logs

Running locally, the contents of tar.gz looks to be correct:

[0 olszewski@Chriss-MacBook-Pro] /tmp/turboreleaser-test $ tar xzf /Users/olszewski/code/vercel/turborepo/cli/dist/darwin-x64-2.4.1-canary.0.tar.gz 
[0 olszewski@Chriss-MacBook-Pro] /tmp/turboreleaser-test $ ls
README.md       bin             package.json
[0 olszewski@Chriss-MacBook-Pro] /tmp/turboreleaser-test $ bat README.md 
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: README.md
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # `turbo`
   2   │ 
   3   │ This is a platform-specific binary for Turborepo, a monorepo build system. See https://github.com/vercel/turborepo for details.
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[0 olszewski@Chriss-MacBook-Pro] /tmp/turboreleaser-test $ bat package.json 
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: package.json
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {
   2   │   "name": "turbo-darwin-64",
   3   │   "version": "2.4.1-canary.0",
   4   │   "description": "The darwin-x64 binary for turbo, a monorepo build system.",
   5   │   "repository": "https://github.com/vercel/turborepo",
   6   │   "bugs": "https://github.com/vercel/turborepo/issues",
   7   │   "homepage": "https://turbo.build/repo",
   8   │   "license": "MIT",
   9   │   "os": [
  10   │     "darwin"
  11   │   ],
  12   │   "cpu": [
  13   │     "x64"
  14   │   ],
  15   │   "preferUnplugged": true
  16   │ }
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
[0 olszewski@Chriss-MacBook-Pro] /tmp/turboreleaser-test $ ls bin 
turbo

What hasn't been tested is the actual npm publish call, but I am fairly certain that will work as it's a very similar shell command to the one used in goreleaser

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 1:29pm

@chris-olszewski chris-olszewski force-pushed the olszewski/chore_remove_goreleaser branch from 8de401e to b596867 Compare February 5, 2025 21:39
@chris-olszewski chris-olszewski force-pushed the olszewski/chore_remove_goreleaser branch from b596867 to ee40557 Compare February 5, 2025 22:12
import path from "node:path";
import type { SupportedArch, HumanArch, Platform } from "./types";

export const archToHuman: Record<SupportedArch, HumanArch> = {
Copy link
Member

Choose a reason for hiding this comment

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

lol at the name


for (const platform of platforms) {
console.log(`Processing platform: ${platform.os}-${platform.arch}`);
// eslint-disable-next-line no-await-in-loop -- We trade of slightly faster releases with more legible logging
Copy link
Member

Choose a reason for hiding this comment

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

+1

@chris-olszewski chris-olszewski merged commit 61425f4 into main Feb 6, 2025
44 checks passed
@chris-olszewski chris-olszewski deleted the olszewski/chore_remove_goreleaser branch February 6, 2025 14:42
chris-olszewski added a commit that referenced this pull request Feb 6, 2025
chris-olszewski added a commit that referenced this pull request Feb 6, 2025
Reverts #9905

Something up with the actual publish step
tknickman pushed a commit that referenced this pull request Feb 7, 2025
### Description

Finally remove `goreleaser` after Go left the codebase a year ago. This
does almost exactly what we were doing with `goreleaser` except we now
base the native releases off of `version.txt` contents like every other
package and not Git tags.

I highly recommend reading each commit especially the first one as I
mark up the `goreleaser` flow we were using explaining what exactly it
did.

**Updates from #9905**
Include `LICENSE` in the native package distributions

Create a tarball containing a directory that contains our package.
Closer reading of the [npm
docs](https://docs.npmjs.com/cli/v8/commands/npm-publish) make it clear
this is what it expects:

> A package is interpreted the same way as other commands:
    a) a folder containing a program described by a `package.json` file
    b) a gzipped tarball containing (a)

We had `wrap_in_directory: true` in our
[goreleaser](https://github.com/vercel/turborepo/blob/main/cli/combined-shim.yml#L45)
workflow which did this for us.

### Testing Instructions

[Latest dry
run](https://github.com/vercel/turborepo/actions/runs/13183590746)

The dry run got up to the [publishing
step](https://github.com/vercel/turborepo/actions/runs/13169658592/job/36758329441#step:10:218)!
All of the `tar.gz` files look correct:
[logs](https://github.com/vercel/turborepo/actions/runs/13169658592/job/36758329441#step:10:298)

Running locally, the contents of `tar.gz` looks to be correct:
```
[0 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo/cli $ tar tf dist/darwin-x64-2.4.1-canary.0.tar.gz
turbo-darwin-x64/
turbo-darwin-x64/LICENSE
turbo-darwin-x64/README.md
turbo-darwin-x64/bin/
turbo-darwin-x64/package.json
turbo-darwin-x64/bin/turbo
```

What hasn't been tested is the actual `npm publish` call, but I am
fairly certain that will work as it's a very similar shell command to
the one used in `goreleaser`
chris-olszewski added a commit that referenced this pull request Feb 10, 2025
### Description

Third try is the charm. See
#9905 and
#9909 for details.

Additional changes:
- Make sure `turbo` binaries are marked as executable. Since they get
downloaded via `@actions/download-artifact` which strips permissions:
[docs](https://github.com/actions/download-artifact?tab=readme-ov-file#permission-loss)
- Correctly set `os: ["win32"]` for the windows package for
`turbo-windows-${arch}`

### Testing Instructions

Changes from previous PRs: added an e2e test to make sure that the
tarball is installable and the included executable is just that.
chris-olszewski added a commit that referenced this pull request Feb 10, 2025
### Description

Third try is the charm. See
#9905 and
#9909 for details.

Additional changes:
- Make sure `turbo` binaries are marked as executable. Since they get
downloaded via `@actions/download-artifact` which strips permissions:
[docs](https://github.com/actions/download-artifact?tab=readme-ov-file#permission-loss)
- Correctly set `os: ["win32"]` for the windows package for
`turbo-windows-${arch}`

### Testing Instructions

Changes from previous PRs: added an e2e test to make sure that the
tarball is installable and the included executable is just that.
joshnuss pushed a commit to joshnuss/turborepo that referenced this pull request Feb 15, 2025
### Description

Third try is the charm. See
vercel#9905 and
vercel#9909 for details.

Additional changes:
- Make sure `turbo` binaries are marked as executable. Since they get
downloaded via `@actions/download-artifact` which strips permissions:
[docs](https://github.com/actions/download-artifact?tab=readme-ov-file#permission-loss)
- Correctly set `os: ["win32"]` for the windows package for
`turbo-windows-${arch}`

### Testing Instructions

Changes from previous PRs: added an e2e test to make sure that the
tarball is installable and the included executable is just that.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants