Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: remove homebrew from release artifacts and switch to monorepo versioning #743

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/install_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ set -o errexit -o nounset -o pipefail
TAG=${GITHUB_REF_NAME}

cat <<EOF
## Install [Aspect CLI](https://www.aspect.build/cli)
## Install Aspect CLI OSS

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:
Configure [bazelisk](https://github.com/bazelbuild/bazelisk) to use the Aspect CLI OSS for all developers in a repository
by adding the following to \`.bazeliskrc\` in the repository root:

\`\`\`
BAZELISK_BASE_URL=https://github.com/aspect-build/aspect-cli/releases/download
USE_BAZEL_VERSION=aspect/${TAG}
\`\`\`

> [!NOTE]
> This approach doesn't provide the \`aspect init\` command, which has to run outside a Bazel workspace.

The underlying version of Bazel can be configured in your \`.bazelversion\` file or the \`BAZEL_VERSION\` environment variable.

EOF
22 changes: 22 additions & 0 deletions .github/workflows/weekly_tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Apply a tag to HEAD at the beginning of each week.
# We can use this to create semver-looking tags for releases like
# 2020.44.123+abc1234
on:
schedule:
# Mondays at 5am UTC / midnight EST
- cron: '0 5 * * 1'
jobs:
tagger:
runs-on: ubuntu-latest
steps:
- name: tag HEAD with date +%Y.%V
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/git/refs \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--data @- << EOF
{
"ref": "refs/tags/$(date +%Y.%V)",
"sha": "${{ github.sha }}"
}
EOF
116 changes: 116 additions & 0 deletions ASPECT_COMMUNITY_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
Aspect Community License

BY DOWNLOADING, COPYING, OR OTHERWISE USING THE SOFTWARE WITH WHICH THIS LICENSE AGREEMENT IS
PROVIDED (THE “SOFTWARE”), YOU OR THE ENTITY YOU REPRESENT (“LICENSEE”) ARE CONSENTING TO BE BOUND
BY AND ARE BECOMING A PARTY TO THIS LICENSE AGREEMENT (“AGREEMENT”).

IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, THEN YOU MAY NOT DOWNLOAD THE SOFTWARE
AND MUST DELETE ANY COPIES THAT YOU HAVE ALREADY DOWNLOADED.

IF LICENSEE IS AN ENTITY, YOU REPRESENT AND WARRANT THAT YOU ARE AUTHORIZED TO BIND LICENSEE.
IF THESE TERMS ARE CONSIDERED AN OFFER, ACCEPTANCE IS EXPRESSLY LIMITED TO THESE TERMS.

1. Grant.

Subject to the terms of this Agreement, Aspect Build Systems, Inc. (“Aspect”)
hereby grants Licensee (and only Licensee) a limited, non-sublicensable, non-transferable,
royalty-free, nonexclusive license to use the Software only in Licensee’s organization and only
in accordance with any documentation that accompanies it.

The Software may only be used by a Licensee who is:
(i) an individual (and only for personal use),
(ii) a Small Business (as defined below),
(iii) a non-profit entity or an academic or university institution, or
(iv) a current or former Aspect Customer (as defined below).

A “Small Business” is any entity with fewer than 50 total employees (including, for purposes
of such calculation, all employees of any entities affiliated with such entity).

An “Aspect Customer” is any entity that has remitted payment to Aspect at any time.
Such payment may be for professional services such as Bazel OSS support, for software licensing
and maintenence such as Aspect Workflows, or for other products or services sold by Aspect.

2. Restrictions.

Licensee may not, directly or indirectly:
(i) copy, distribute, rent, lease, timeshare, operate a service bureau with, use commercially
or for the benefit of a third party, the Software,
(ii) reverse engineer, disassemble, decompile, attempt to discover the source code or
structure, sequence and organization of, or remove any proprietary notices from, any non-source
forms of the Software.

As between the parties, title, ownership rights, and intellectual property rights in and to the
Software, and any copies or portions thereof, shall remain in Aspect and its suppliers or
licensors. Licensee understands that Aspect may modify or discontinue offering the
Software at any time. The Software is protected by the copyright laws of the United States and
international copyright treaties.

This Agreement does not grant any rights not expressly granted herein.

3. Feedback.

Licensee may provide any feedback, suggestions, or comments to Aspect
regarding the Software (“Feedback”). Licensee hereby grants Aspect a nonexclusive,
perpetual, worldwide, royalty-free, fully paid-up, sublicensable, transferable license to use,
make available and otherwise exploit the Feedback for any purpose.

4. Support and Upgrades.

This Agreement does not entitle Licensee to any support, upgrades,
patches, enhancements, or fixes for the Software (collectively, “Support”).
Any such Support for the Software that may be made available by Aspect shall become
part of the Software and subject to this Agreement.

5. Disclaimer.

ASPECT PROVIDES THE SOFTWARE “AS IS” AND WITHOUT WARRANTY OF ANY KIND, AND
ASPECT HEREBY DISCLAIMS ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, PERFORMANCE, ACCURACY,
RELIABILITY, AND NON-INFRINGEMENT. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
THIS AGREEMENT.

6. Limitation of liability.

UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, INCLUDING, WITHOUT
LIMITATION, TORT, CONTRACT, STRICT LIABILITY, OR OTHERWISE, SHALL ASPECT OR ITS
LICENSORS, SUPPLIERS OR RESELLERS BE LIABLE TO LICENSEE OR ANY OTHER PERSON FOR ANY DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, ACCURACY OF RESULTS,
COMPUTER FAILURE OR MALFUNCTION, DAMAGES RESULTING FROM LICENSEE’S USE OF THE SOFTWARE.

7. Termination.

Licensee may terminate this Agreement and the license granted herein at any time
by destroying or removing from all computers, networks, and storage media all copies of the
Software. Aspect may terminate this Agreement and the license granted herein immediately
if Licensee breaches any provision of this Agreement. Upon receiving notice of termination from
Aspect, Licensee will destroy or remove from all computers, networks, and storage media
all copies of the Software. Sections 2 through 9 shall survive termination of this Agreement.

8. Export Controls.

Licensee shall comply with all export laws and restrictions and regulations of
the Department of Commerce, the United States Department of Treasury Office of Foreign Assets
Control (“OFAC”), or other United States or foreign agency or authority, and not to export, or
allow the export or re-export of the Software in violation of any such restrictions, laws or
regulations. By downloading or using the Software, Licensee is agreeing to the foregoing and
Licensee is representing and warranting that Licensee is not located in, under the control of,
or a national or resident of any restricted country or on any such list.

9. Miscellaneous.

Licensee shall comply with all applicable export laws, restrictions and
regulations in connection with Licensee’s use of the Software, and will not export or
re-export the Software in violation thereof. This Agreement is personal to Licensee and
Licensee shall not assign or transfer the Agreement or the Software to any third party under
any circumstances.

This Agreement represents the complete agreement concerning this license
between the parties and supersedes all prior agreements and representations between them.
It may be amended only by a writing executed by both parties.

If any provision of this Agreement is held to be unenforceable for any reason, such provision
shall be reformed only to the extent necessary to make it enforceable.

This Agreement shall be governed by and construed under California law as such law applies to
agreements between California residents entered into and to be performed within California.
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
```
79 changes: 57 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: Aspect CLI
sidebar_label: Overview
---

The `aspect` CLI is a drop-in replacement for the `bazel` CLI that comes with Bazel.
Aspect CLI (`aspect`) is a drop-in replacement for the CLI that comes with [Bazel](http://bazel.build) that adds additional features and extensibility to the popular polyglot build system from Google.

# Why Aspect CLI
# Why Aspect CLI?

Every organization has a different engineering culture and developer stack.
Bazel was designed for Google's workflows, not yours.
Expand All @@ -15,41 +15,78 @@ untested Bash script living in `/tools/bazel` which Bazelisk understands as a wr

Over time, the wrapper accumulates more code, and is a constant source of developer distress.

See more on our product webpage: <https://aspect.build/cli>
See more on our docsite: <https://docs.aspect.build/cli/>

# Licenses

# Aspect CLI OSS

Aspect CLI OSS, the open-source, open-core portion of the Aspect CLI, is found in this repository and is [Apache 2](./LICENSE) licensed.

# Aspect CLI

The standard Aspect CLI is built on top of the open-source, open-core portion found is this repository and is licensed under the [Aspect Community License](./ASPECT_COMMUNITY_LICENSE). The parts of the Aspect CLI that are not found in this repository are closed source.

We intend for Aspect CLI to remain free for individuals (only for personal use), Small Business (fewer than 50 employees), and non-profit or academic institutions. Please contact Aspect at https://aspect.build if you would like to use the Aspect CLI and fall outside of free use.

# Installation

## Homebrew (MacOS)
## Aspect CLI OSS

### Bazelisk (MacOS / Linux)

Aspect CLI OSS can be installed in an existing Bazel workspace using [bazelisk].

> [!NOTE]
> This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.

From the [OSS 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 the target repository.

The underlying version of Bazel can be configured in your `.bazelversion` file or the `BAZEL_VERSION` environment variable.

On MacOS, you can run
### Manual (MacOS / Linux)

On any platform, you can download the Aspect CLI OSS `aspect` binary for your platform on our
[Releases](https://github.com/aspect-build/aspect-cli/releases) page and add it to your `PATH` manually.

Note, if you manually install for MacOS, you can bypass the "Unknown Developer" dialog by running
`xattr -c $(which aspect)` before launching `aspect`.

## Aspect CLI Standard

### Homebrew (MacOS)

To install the Aspect CLI on MacOS, you can run

```sh
% brew install aspect-build/aspect/aspect
```

This installs the `aspect` command and also links it to `bazel`, just like the [bazelisk] installer does.

## Manual (MacOS / Linux)
### Bazelisk (MacOS / Linux)

On any platform, you can download the `aspect` binary for your platform on our
[Releases](https://github.com/aspect-build/aspect-cli/releases) page and add it to your `PATH` manually.
Aspect CLI can be installed in an existing Bazel workspace using [bazelisk].

Note, if you manually install for MacOS, you can bypass the "Unknown Developer" dialog by running
`xattr -c $(which aspect)` before launching `aspect`.
> [!NOTE]
> This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.

## Ensuring everyone on the team uses `aspect`
Configure [bazelisk](https://github.com/bazelbuild/bazelisk) to use the Aspect CLI for all developers in a repository
by adding the following to \`.bazeliskrc\` in the repository root:

In an already-existing Bazel workspace, you can have [bazelisk]
install the Aspect CLI just like it can install the standard Bazel CLI.
\`\`\`
BAZELISK_BASE_URL=https://static.aspect.build/aspect
USE_BAZEL_VERSION=aspect/xxxx.xx.xx
\`\`\`

>[!NOTE]
>This approach doesn't provide the `aspect init` command, which has to run outside a Bazel workspace.
Check the Aspect CLI [Homebrew formula](https://github.com/aspect-build/homebrew-aspect/blob/main/Formula/aspect.rb) for
latest version of Aspect CLI.

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]
> An Aspect CLI releases page with release notes and past releases is coming soon.

Note that in all cases, the `.bazelversion` file continues to indicate which version of the
Bazel tool is fetched and run beneath the wrapper.
The underlying version of Bazel can be configured in your `.bazelversion` file or the `BAZEL_VERSION` environment variable.

## Windows

Expand Down Expand Up @@ -81,14 +118,12 @@ See the [Plugin Documentation](./plugins.md) for more information on how to writ

If you think you've hit a bug please file a [Bug Report](https://github.com/aspect-build/aspect-cli/issues/new/choose).

You can also find us on [Bazel Slack](https://slack.bazel.build/) on the #aspect-dev channel.
You can also find us on [Bazel Slack](https://slack.bazel.build/) on the #aspect-build channel.

# For Enterprise

Aspect CLI is built by [Aspect](http://aspect.build).

See our website at <http://aspect.build> to learn more about our product offerings.

[bazel]: http://bazel.build
[github releases]: https://github.com/aspect-dev/aspect-cli/releases
[bazelisk]: https://github.com/bazelbuild/bazelisk
2 changes: 1 addition & 1 deletion buildinfo/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _GO_STAMP_X_DEFS = {
"GitCommit": "{STABLE_BUILD_SCM_SHA}",
"GitStatus": "{STABLE_BUILD_SCM_LOCAL_CHANGES}",
"HostName": "{BUILD_HOST}",
"Release": "{STABLE_BUILD_SCM_TAG}",
"Release": "{STABLE_ASPECT_CLI_VERSION}",
}

go_library(
Expand Down
Loading
Loading