Skip to content

Commit 0bec790

Browse files
committed
feat: add binary releases
1 parent 15accac commit 0bec790

File tree

11 files changed

+417
-66
lines changed

11 files changed

+417
-66
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111

1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515

1616
- name: Setup Node
17-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
17+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
1818
with:
1919
cache: 'npm'
2020

.github/workflows/deploy-npm.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
permissions:
8+
contents: write
9+
10+
concurrency:
11+
group: release
12+
cancel-in-progress: false
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
strategy:
19+
matrix:
20+
node-version: ['24', '22', '20']
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Run unit tests
35+
run: npm test
36+
37+
build:
38+
needs: test
39+
strategy:
40+
matrix:
41+
include:
42+
- os: ubuntu-latest
43+
target: linux-x64
44+
platform: linux
45+
arch: amd64
46+
- os: ubuntu-latest
47+
target: linux-arm64
48+
platform: linux
49+
arch: arm64
50+
- os: macos-latest
51+
target: darwin-x64
52+
platform: darwin
53+
arch: amd64
54+
- os: macos-latest
55+
target: darwin-arm64
56+
platform: darwin
57+
arch: arm64
58+
- os: windows-latest
59+
target: windows-x64
60+
platform: windows
61+
arch: amd64
62+
63+
runs-on: ${{ matrix.os }}
64+
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
68+
69+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
70+
with:
71+
bun-version: 1
72+
73+
- name: Install dependencies
74+
run: bun install --frozen-lockfile
75+
76+
- name: Build TypeScript
77+
run: bun run build
78+
79+
- name: Build binary
80+
shell: bash
81+
run: |
82+
BINARY_NAME="make-cli-${{ matrix.platform }}-${{ matrix.arch }}"
83+
if [ "${{ matrix.platform }}" = "windows" ]; then
84+
bun build dist/index.js --compile --target=bun-${{ matrix.target }} --outfile="${BINARY_NAME}.exe"
85+
else
86+
bun build dist/index.js --compile --target=bun-${{ matrix.target }} --outfile="${BINARY_NAME}"
87+
fi
88+
89+
- name: Create tar.gz archive
90+
shell: bash
91+
run: |
92+
BINARY_NAME="make-cli-${{ matrix.platform }}-${{ matrix.arch }}"
93+
if [ "${{ matrix.platform }}" = "windows" ]; then
94+
tar -czvf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}.exe"
95+
else
96+
tar -czvf "${BINARY_NAME}.tar.gz" "${BINARY_NAME}"
97+
fi
98+
99+
- name: Upload artifact
100+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
101+
with:
102+
name: make-cli-${{ matrix.platform }}-${{ matrix.arch }}.tar.gz
103+
path: make-cli-*.tar.gz
104+
retention-days: 7
105+
106+
build-deb:
107+
needs: build
108+
runs-on: ubuntu-latest
109+
strategy:
110+
matrix:
111+
arch: [amd64, arm64]
112+
113+
steps:
114+
- name: Checkout
115+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
116+
117+
- name: Download linux binary
118+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
119+
with:
120+
name: make-cli-linux-${{ matrix.arch }}.tar.gz
121+
path: .
122+
123+
- name: Extract binary
124+
run: |
125+
mkdir -p bin
126+
tar -xzvf "make-cli-linux-${{ matrix.arch }}.tar.gz" -C bin/
127+
128+
- name: Build Debian package
129+
run: |
130+
VERSION="${GITHUB_REF_NAME#v}"
131+
./scripts/build-deb.sh "$VERSION" "${{ matrix.arch }}"
132+
133+
- name: Upload artifact
134+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
135+
with:
136+
name: make-cli-linux-${{ matrix.arch }}.deb
137+
path: deb/*.deb
138+
retention-days: 7
139+
140+
release:
141+
needs: [build, build-deb]
142+
runs-on: ubuntu-latest
143+
permissions:
144+
contents: write
145+
id-token: write
146+
147+
steps:
148+
- name: Checkout
149+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
150+
151+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
152+
with:
153+
bun-version: latest
154+
155+
- name: Setup Node
156+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
157+
with:
158+
node-version: 24
159+
registry-url: 'https://registry.npmjs.org'
160+
cache: 'npm'
161+
162+
- name: Install dependencies
163+
run: bun install --frozen-lockfile
164+
165+
- name: Build
166+
run: bun run build
167+
168+
- name: Publish to npm
169+
run: npm publish --provenance --access public
170+
env:
171+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
172+
173+
- name: Download all artifacts
174+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
175+
with:
176+
path: artifacts/
177+
178+
- name: Create release
179+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
180+
with:
181+
files: |
182+
artifacts/**/*
183+
184+
update-homebrew:
185+
needs: release
186+
runs-on: ubuntu-latest
187+
if: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY != '' }}
188+
189+
steps:
190+
- name: Checkout
191+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
192+
193+
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
194+
with:
195+
bun-version: latest
196+
197+
- name: Download artifacts
198+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
199+
with:
200+
path: artifacts/
201+
202+
- name: Generate Homebrew formula
203+
run: |
204+
VERSION="${GITHUB_REF_NAME#v}"
205+
VERSION="$VERSION" ARTIFACTS_DIR="artifacts" bun run scripts/update-homebrew.ts
206+
207+
- name: Push to homebrew-tap
208+
env:
209+
SSH_PRIVATE_KEY: ${{ secrets.HOMEBREW_TAP_DEPLOY_KEY }}
210+
run: |
211+
mkdir -p ~/.ssh
212+
echo "$SSH_PRIVATE_KEY" > ~/.ssh/deploy_key
213+
chmod 600 ~/.ssh/deploy_key
214+
ssh-keyscan github.com >> ~/.ssh/known_hosts
215+
216+
git clone git@github.com:integromat/homebrew-tap.git tap --config core.sshCommand="ssh -i ~/.ssh/deploy_key"
217+
cp make-cli.rb tap/make-cli.rb
218+
cd tap
219+
git config user.name "make-cli-release-bot"
220+
git config user.email "make-cli-release-bot@make.com"
221+
git config core.sshCommand "ssh -i ~/.ssh/deploy_key"
222+
git add make-cli.rb
223+
git diff --staged --quiet || git commit -m "make-cli ${GITHUB_REF_NAME#v}"
224+
git push

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
node-version: ['24', '22', '20']
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919

2020
- name: Setup Node
21-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
21+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
cache: 'npm'

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ coverage
1111
.env
1212
node_modules/*
1313
dist
14-
docs
14+
docs
15+
bin

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,39 @@ A command-line interface for interacting with the [Make](https://www.make.com) a
44

55
## Installation
66

7+
### npm
8+
79
```bash
810
npm install -g @makehq/cli
911
```
1012

13+
### Binary releases
14+
15+
Pre-built binaries are available for download from the [GitHub Releases](https://github.com/integromat/make-cli/releases) page:
16+
17+
| Platform | Architecture | File |
18+
| -------- | --------------------- | ------------------------------- |
19+
| Linux | x86_64 | `make-cli-linux-amd64.tar.gz` |
20+
| Linux | arm64 | `make-cli-linux-arm64.tar.gz` |
21+
| macOS | x86_64 (Intel) | `make-cli-darwin-amd64.tar.gz` |
22+
| macOS | arm64 (Apple Silicon) | `make-cli-darwin-arm64.tar.gz` |
23+
| Windows | x86_64 | `make-cli-windows-amd64.tar.gz` |
24+
25+
Download and extract the archive for your platform, then place the binary somewhere on your `PATH`.
26+
27+
### Debian/Ubuntu
28+
29+
`.deb` packages are also available for Linux:
30+
31+
| Architecture | File |
32+
| ------------ | -------------------------- |
33+
| x86_64 | `make-cli-linux-amd64.deb` |
34+
| arm64 | `make-cli-linux-arm64.deb` |
35+
36+
```bash
37+
sudo dpkg -i make-cli-linux-amd64.deb
38+
```
39+
1140
## Authentication
1241

1342
The CLI requires an API key and zone. These can be provided as flags or environment variables:

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@makehq/cli",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "A command-line tool for Make automation platform",
55
"license": "MIT",
66
"author": "Make",

0 commit comments

Comments
 (0)