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

Add arm64 macos binary #2461

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions auto.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const allContributorsOptions: IAllContributorsPluginOptions = {
};

const brewOptions: IBrewPluginOptions = {
executable: "./packages/cli/binary/auto-macos.gz",
executable: "./packages/cli/binary/auto-macos-x64.gz",
name: "auto",
};

Expand All @@ -36,9 +36,10 @@ export default function rc(): AutoRc {
[
"upload-assets",
[
"./packages/cli/binary/auto-linux.gz",
"./packages/cli/binary/auto-macos.gz",
"./packages/cli/binary/auto-win.exe.gz",
"./packages/cli/binary/auto-linux-x64.gz",
"./packages/cli/binary/auto-macos-x64.gz",
"./packages/cli/binary/auto-macos-arm64.gz",
"./packages/cli/binary/auto-win-x64.exe.gz",
],
],
["npm", npmOptions],
Expand Down
15 changes: 5 additions & 10 deletions docs/pages/docs/configuration/non-npm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@
title: Non-npm Usage
---

If you're on some platform other than [npm](https://npmjs.com) it doesn't make sense to download `auto` through [npm](https://npmjs.com).
For these situations we package `auto` for all major operating systems (`linux`, `osx`, `windows`).
If you're on some platform other than [npm](https://npmjs.com) it doesn't make sense to download `auto` through [npm](https://npmjs.com). For these situations we package `auto` for all major operating systems (`linux`, `osx`, `windows`).

## Installation

Simply download the appropriate version for your operating system and make it executable.

```bash
# Download a platform specific version of auto
curl -vkL -o - https://github.com/intuit/auto/releases/download/v11.1.6/auto-linux.gz | gunzip > ~/auto
curl -vkL -o - https://github.com/intuit/auto/releases/download/v11.1.6/auto-linux-x64.gz | gunzip > ~/auto
# Make auto executable
chmod a+x ~/auto
```

This executable contains all of the official `auto` plugins so you do not have to download anything extra.
This version of `auto` uses the [git-tag](../generated/git-tag) plugins as the default instead of [npm](../generated/npm).
If you specify any plugins this will be overridden.
This executable contains all of the official `auto` plugins so you do not have to download anything extra. This version of `auto` uses the [git-tag](../generated/git-tag) plugins as the default instead of [npm](../generated/npm). If you specify any plugins this will be overridden.

### Installation via brew (OSX)

Expand Down Expand Up @@ -78,8 +75,7 @@ Now that you have `auto` all set up you can use all of it's commands!

## Plugins

As stated above, all of the official plugins (the ones included in this repo/docs) are included in the binary version of `auto`.
However you might want to use an unofficial plugin or even write your own.
As stated above, all of the official plugins (the ones included in this repo/docs) are included in the binary version of `auto`. However you might want to use an unofficial plugin or even write your own.

#### Local Plugins

Expand All @@ -100,8 +96,7 @@ You could:

#### Hosted Plugins

If you want to share your custom plugins between projects then you can host them on some SCM (ex: GitHub).
A plugin just needs to consist of an `index.js` that implements your plugin. (or it could be as complex as any NPM package)
If you want to share your custom plugins between projects then you can host them on some SCM (ex: GitHub). A plugin just needs to consist of an `index.js` that implements your plugin. (or it could be as complex as any NPM package)

Edit your CI build to download these plugins when building.

Expand Down
4 changes: 2 additions & 2 deletions formula-template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Auto < Formula

def install
libexec.install Dir["*"]
bin.install libexec/"auto-macos"
mv bin/"auto-macos", bin/"auto"
bin.install libexec/"auto-macos-x64"
mv bin/"auto-macos-x64", bin/"auto"
end

test do
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"docs:build": "yarn docs:generate && ignite build",
"create:plugin": "./scripts/create-plugin.js",
"create:package": "./scripts/create-package.js",
"install-mac": "yarn lerna run bundle --scope=auto && gunzip -c ./packages/cli/binary/auto-macos.gz > /usr/local/bin/auto",
"install-mac": "yarn lerna run bundle --scope=auto && gunzip -c ./packages/cli/binary/auto-macos-x64.gz > /usr/local/bin/auto",
"postinstall": "patch-package"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/__tests__/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ test("bundle should function", () => {
(process.platform === "win32" && "win.exe") ||
(process.platform === "darwin" && "macos") ||
"linux";
const zip = path.join(__dirname, `../binary/auto-${type}`);

const { arch } = process;
const zip = path.join(__dirname, `../binary/auto-${type}-${arch}`);
const binary = path.join(__dirname, "../auto");

execSync(`gunzip -c ${zip} > ${binary}`);
Expand Down
8 changes: 7 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
"email": "[email protected]"
},
"pkg": {
"scripts": "../../plugins/**/dist/**/*.js"
"scripts": "../../plugins/**/dist/**/*.js",
"targets": [
"linux-x64",
"win-x64",
"macos-x64",
"macos-arm64"
]
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
Expand Down
12 changes: 5 additions & 7 deletions plugins/brew/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Brew Plugin

Automate the creation of Homebrew formulae.
This plugin can be use with any other package manager plugin.
Automate the creation of Homebrew formulae. This plugin can be use with any other package manager plugin.

> NOTE: This plugin does not work in `lerna` monorepos that use `independent` versioning.

Expand Down Expand Up @@ -38,8 +37,7 @@ To use this plugin you will need to add the required configuration and a templat
}
```

Create a template name `./formula-template.rb` at the root of the project (or use the `formula` option to customize the location)/
The template file must be a valid homebrew ruby file.
Create a template name `./formula-template.rb` at the root of the project (or use the `formula` option to customize the location)/ The template file must be a valid homebrew ruby file.

`auto` will replace the following tokens in the template file:

Expand All @@ -52,14 +50,14 @@ Here is the template `auto` uses to publish it's own `brew` formula:
class Auto < Formula
desc "Generate releases based on semantic version labels on pull requests."
homepage "https://intuit.github.io/auto/home.html"
url "https://github.com/intuit/auto/releases/download/$VERSION/auto-macos.gz"
url "https://github.com/intuit/auto/releases/download/$VERSION/auto-macos-x64.gz"
version "$VERSION"
sha256 "$SHA"

def install
libexec.install Dir["*"]
bin.install libexec/"auto-macos"
mv bin/"auto-macos", bin/"auto"
bin.install libexec/"auto-macos-x64"
mv bin/"auto-macos-x64", bin/"auto"
end

test do
Expand Down
2 changes: 1 addition & 1 deletion scripts/auto-update-curl-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = class TestPlugin {
fs.writeFileSync(
filename,
nonNpmDocs.replace(
/(download\/v)(\d+\.\d+\.\d+)(\/auto-linux\.gz)/,
/(download\/v)(\d+\.\d+\.\d+)(\/auto-linux-x64\.gz)/,
`$1${inc(lastRelease, bump)}$3`
)
);
Expand Down
Loading