Skip to content

Commit

Permalink
chore: remove homebrew from release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Sep 10, 2024
1 parent 18e978c commit 4224a33
Show file tree
Hide file tree
Showing 22 changed files with 18 additions and 1,525 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/install_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ cat <<EOF
See full install instructions in [README.md](https://github.com/aspect-build/aspect-cli/blob/${TAG}/README.md).
### Homebrew (MacOS)
Link the [Aspect CLI](https://www.aspect.build/cli) as \`bazel\` just like the [bazelisk](https://github.com/bazelbuild/bazelisk) installer does:
\`\`\`
% brew install aspect-build/aspect/aspect
\`\`\`
### Bazelisk (MacOS / Linux)
Configure [bazelisk](https://github.com/bazelbuild/bazelisk) to use the [Aspect CLI](https://www.aspect.build/cli) for all developers. Add this to \`.bazeliskrc\` in your project folder:
Expand Down
51 changes: 0 additions & 51 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,54 +78,3 @@ After this, you should be able to merge your changes without any conflicts in th
git tag v1.5xx.x
git push origin $_
```

5. Update Homebrew Formula

Once the GitHub release is complete and Aspect CLI release artifacts are available for download,
follow the [instructions](https://github.com/aspect-build/homebrew-aspect#updating-formulas-to-the-latest-release)
in our [homebrew-aspect](https://github.com/aspect-build/homebrew-aspect) repository to update the
Homebrew Formulas in the `aspect-build/aspect` tap.

## Test Homebrew Formula and Bottles

### Install and Configure `nginx`

Install `nginx`. On MacOS, run `brew install nginx`.

Change the `nginx` config so that it listens on part `8090`. By default, `nginx` will listen on
`localhost:8080`.

- Find the location of your `nginx` config, run `nginx -t`.
- Update the default server stanza to listen on `8090`. It should look like the following:

```
server {
listen 8090;
server_name localhost;
```

- Restart `nginx`. Run `brew services restart nginx`.

### Build, Stage, and Install Aspect CLI with Homebrew

To verify that the built Homebrew formula and bottles build and install properly,
please run the following:

```sh
$ bazel run //release:verify_homebrew_artifacts
```

This will build the artifacts, copy the bottles to your local `nginx` webserver's
serving directory, create an `aspect-build/aspect` tap, copy the formula to the
tap, install the bottle for your system, and verify that the version from the
CLI matches the expected version.

NOTE: This is not a test target, because it will copy files to various locations on your local
machine. The default permissions for a test target do not allow this.

If you would like to perform the set up for this verification step without the assertions, you can
run the following (with or without the `--stamp` flag):

```sh
$ bazel run //release:stage_for_dev
```
30 changes: 10 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@ See more on our product webpage: <https://aspect.build/cli>

# Installation

## Homebrew (MacOS)
## Bazelisk (MacOS / Linux)

On MacOS, you can run
In an already-existing Bazel workspace, you can have [bazelisk]
install the Aspect CLI just like it can install the standard Bazel CLI.

```sh
% brew install aspect-build/aspect/aspect
```
> [!NOTE]
> This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.
This installs the `aspect` command and also links it to `bazel`, just like the [bazelisk] installer does.
From the [releases page](https://github.com/aspect-build/aspect-cli/releases),
copy the `.bazeliskrc` snippet into your `.bazeliskrc` file to install Aspect for all developers in this repository.

Note that in all cases, the `.bazelversion` file continues to indicate which version of the
Bazel tool is fetched and run beneath the wrapper.

## Manual (MacOS / Linux)

Expand All @@ -37,20 +41,6 @@ On any platform, you can download the `aspect` binary for your platform on our
Note, if you manually install for MacOS, you can bypass the "Unknown Developer" dialog by running
`xattr -c $(which aspect)` before launching `aspect`.

## Ensuring everyone on the team uses `aspect`

In an already-existing Bazel workspace, you can have [bazelisk]
install the Aspect CLI just like it can install the standard Bazel CLI.

>[!NOTE]
>This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.
From the [releases page](https://github.com/aspect-build/aspect-cli/releases),
copy the `.bazeliskrc` snippet into your `.bazeliskrc` file to install Aspect for all developers in this repository.

Note that in all cases, the `.bazelversion` file continues to indicate which version of the
Bazel tool is fetched and run beneath the wrapper.

## Windows

Windows releases are no longer published as of [v5.5.0](https://github.com/aspect-build/aspect-cli/releases/tag/5.5.0).
Expand Down
64 changes: 8 additions & 56 deletions release/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(":bazelisk_artifacts.bzl", "bazelisk_artifacts")
load(":cli_brew_artifacts.bzl", "cli_brew_artifacts")
load(":release.bzl", "multi_platform_binaries", "release")
load(":version_file.bzl", "version_file")

multi_platform_binaries(
name = "aspect",
embed = ["//cmd/aspect:aspect_lib"],
tags = ["manual"],
)

version_file(
name = "aspect_version",
version_var = "STABLE_BUILD_SCM_TAG",
expand_template(
name = "aspect_version_file",
out = "aspect_version",
stamp_substitutions = {
"0.0.0-PLACEHOLDER": "{{STABLE_BUILD_SCM_TAG}}",
},
template = ["0.0.0-PLACEHOLDER"],
)

bazelisk_artifacts(
Expand All @@ -25,36 +28,12 @@ bazelisk_artifacts(
version_file = ":aspect_version",
)

cli_brew_artifacts(
name = "aspect_brew_artifacts",
additional_bins = [":bazel"],
# Based on Bazelisk brew formula:
# https://github.com/Homebrew/homebrew-core/blob/7ee2ad3624ac2364aabf28c8d8ee5efaf8592ef1/Formula/bazelisk.rb
additional_content = """
conflicts_with "bazel", because: "aspect replaces the bazel binary"
conflicts_with "bazelisk", because: "aspect replaces the bazel binary"
""",
binary_name = "aspect",
bottle_root_url = "https://github.com/aspect-build/aspect-cli/releases/download/0.0.0-PLACEHOLDER",
desc = "Correct, fast, usable: choose three",
formula_name = "aspect",
homepage = "https://aspect.build/cli",
license = "Apache-2.0",
root_files = [
"//:LICENSE",
"//:README.md",
],
url = "https://github.com/aspect-build/aspect-cli",
version_file = ":aspect_version",
)

release(
name = "release",
tags = ["manual"],
targets = [
":aspect",
":aspect_bazelisk_artifacts",
":aspect_brew_artifacts",
],
)

Expand All @@ -66,31 +45,6 @@ bzl_library(

exports_files(["version.tmpl"])

# TODO: this is out-of-date and no longer working. Leaving here for future use.
sh_binary(
name = "stage_for_dev",
srcs = ["stage_for_dev.sh"],
data = [
":aspect_brew_artifacts_dev",
],
)

# This is not a test target because it will copy files to your local
# system. However, it will fail if any steps fail or if the assertions are not
# met.
sh_binary(
name = "verify_homebrew_artifacts",
testonly = True,
srcs = ["verify_homebrew_artifacts.sh"],
data = [
":aspect_version",
":stage_for_dev",
],
deps = [
"@aspect_bazel_lib//shlib/lib:assertions",
],
)

# Demonstration delivery target for Aspect Workflows.
# In the future this could be wired up to push dev releases to an S3 bucket.
sh_binary(
Expand All @@ -99,7 +53,6 @@ sh_binary(
data = [
":aspect",
":aspect_bazelisk_artifacts",
":aspect_brew_artifacts",
],
)

Expand All @@ -111,7 +64,6 @@ sh_binary(
data = [
":aspect",
":aspect_bazelisk_artifacts",
":aspect_brew_artifacts",
],
tags = ["deliverable"],
)
3 changes: 0 additions & 3 deletions release/bazel

This file was deleted.

51 changes: 0 additions & 51 deletions release/brew/BUILD.bazel

This file was deleted.

Loading

0 comments on commit 4224a33

Please sign in to comment.