Skip to content
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
82 changes: 60 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
# them on launch (oven-sh/bun#29120). Unpin once a Bun release includes the
# upstream fix (oven-sh/bun#29122).
CLI_BUN_VERSION: '1.3.11'
HOMEBREW_TAP_REPO: appwrite/homebrew-appwrite
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -75,33 +76,34 @@ jobs:
GHR_REPLACE: false
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Update Homebrew formula checksums
- name: Check out Homebrew tap
uses: actions/checkout@v4
with:
repository: ${{ env.HOMEBREW_TAP_REPO }}
token: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
path: homebrew-tap
fetch-depth: 0

- name: Update Homebrew formula in tap
id: tap
working-directory: homebrew-tap
Comment thread
ChiragAgg5k marked this conversation as resolved.
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
TARGET_COMMITISH: ${{ github.event.release.target_commitish }}
run: |
set -euo pipefail

TARGET_BRANCH="$TARGET_COMMITISH"
if ! git ls-remote --exit-code --heads origin "$TARGET_BRANCH" >/dev/null 2>&1; then
TARGET_BRANCH="master"
fi

git fetch origin "$TARGET_BRANCH"
git switch -C "$TARGET_BRANCH" "origin/$TARGET_BRANCH"

FORMULA_PATH="$(find Formula -maxdepth 1 -name '*.rb' | head -n 1)"
if [ -z "$FORMULA_PATH" ]; then
echo "Formula file not found"
echo "No formula found in Homebrew tap"
exit 1
fi

EXECUTABLE_NAME="$(basename "$FORMULA_PATH" .rb)"
export FORMULA_PATH RELEASE_TAG EXECUTABLE_NAME
export MAC_ARM64_SHA256="$(sha256sum "build/${EXECUTABLE_NAME}-cli-darwin-arm64" | awk '{print $1}')"
export MAC_X64_SHA256="$(sha256sum "build/${EXECUTABLE_NAME}-cli-darwin-x64" | awk '{print $1}')"
export LINUX_ARM64_SHA256="$(sha256sum "build/${EXECUTABLE_NAME}-cli-linux-arm64" | awk '{print $1}')"
export LINUX_X64_SHA256="$(sha256sum "build/${EXECUTABLE_NAME}-cli-linux-x64" | awk '{print $1}')"

export FORMULA_PATH EXECUTABLE_NAME
export MAC_ARM64_SHA256="$(sha256sum "../build/${EXECUTABLE_NAME}-cli-darwin-arm64" | awk '{print $1}')"
export MAC_X64_SHA256="$(sha256sum "../build/${EXECUTABLE_NAME}-cli-darwin-x64" | awk '{print $1}')"
export LINUX_ARM64_SHA256="$(sha256sum "../build/${EXECUTABLE_NAME}-cli-linux-arm64" | awk '{print $1}')"
export LINUX_X64_SHA256="$(sha256sum "../build/${EXECUTABLE_NAME}-cli-linux-x64" | awk '{print $1}')"

ruby <<'RUBY'
formula_path = ENV.fetch("FORMULA_PATH")
Expand Down Expand Up @@ -132,13 +134,49 @@ jobs:

ruby -c "$FORMULA_PATH"

{
echo "executable=${EXECUTABLE_NAME}"
echo "formula_path=${FORMULA_PATH}"
} >> "$GITHUB_OUTPUT"

- name: Open pull request on Homebrew tap
working-directory: homebrew-tap
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
EXECUTABLE_NAME: ${{ steps.tap.outputs.executable }}
FORMULA_PATH: ${{ steps.tap.outputs.formula_path }}
SOURCE_REPO: ${{ github.repository }}
SERVER_URL: ${{ github.server_url }}
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
run: |
set -euo pipefail

if git diff --quiet -- "$FORMULA_PATH"; then
echo "Homebrew formula already up to date"
echo "Homebrew formula already up to date for ${RELEASE_TAG}"
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
BASE_BRANCH="$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')"
BRANCH="release/${EXECUTABLE_NAME}-${RELEASE_TAG}"

git config user.name "appwrite-bot"
git config user.email "bot@appwrite.io"

git checkout -B "$BRANCH"
git add "$FORMULA_PATH"
git commit -m "chore: update Homebrew formula for ${RELEASE_TAG}"
git push origin "$TARGET_BRANCH"
git commit -m "${EXECUTABLE_NAME} ${RELEASE_TAG}"
git push -f -u origin "$BRANCH"

PR_TITLE="${EXECUTABLE_NAME} ${RELEASE_TAG}"
PR_BODY=$(printf 'Automated formula update for the `%s` CLI release [`%s`](%s/%s/releases/tag/%s).\n\nOpened automatically by the `%s` publish workflow after release binaries were uploaded.' "$EXECUTABLE_NAME" "$RELEASE_TAG" "$SERVER_URL" "$SOURCE_REPO" "$RELEASE_TAG" "${SOURCE_REPO#*/}")

EXISTING_PR="$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number' || true)"
if [ -n "$EXISTING_PR" ]; then
gh pr edit "$EXISTING_PR" --title "$PR_TITLE" --body "$PR_BODY"
else
gh pr create \
--title "$PR_TITLE" \
--body "$PR_BODY" \
--base "$BASE_BRANCH" \
--head "$BRANCH"
fi
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change Log

## 19.0.0

* Breaking: Renamed `project update-protocol-status` to `project update-protocol`
* Breaking: Renamed `project update-service-status` to `project update-service`
* Breaking: Removed `projects get-sms-template`, `projects update-sms-template`, and `projects delete-sms-template` commands
* Breaking: Made `--locale` optional on `projects get-email-template`, `projects update-email-template`, and `projects delete-email-template`
* Breaking: Reordered `projects update-email-template` parameters — `--locale` is now optional and placed after `--message`
* Added `--path` prompt during `init site` to choose the local site directory
* Added support for initializing sites into existing non-empty directories without a starter template
* Added structured column renderer for `runtimes` listings
* Added activity-based deployment timeout tracking so healthy long builds in `push function` and `push site` no longer time out prematurely
* Updated `brew install`/`brew upgrade` to use the fully-qualified `appwrite/appwrite/appwrite` formula from the `appwrite/homebrew-appwrite` tap
* Updated `deploymentRetention` prompt to clarify it counts days of non-active deployments
* Updated CLI help and error output to display the correct program name `appwrite`
* Removed `enabled` field from site entries in `appwrite.config.json`
* Fixed command help text to render links inline without markdown brackets

## 18.2.0

* Added source code and entrypoint validation before local function execution
Expand Down
68 changes: 0 additions & 68 deletions Formula/appwrite.rb

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Command Line SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.1-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.2-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down Expand Up @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
18.2.0
19.0.0
```

### Install using prebuilt binaries
Expand All @@ -42,12 +42,12 @@ If you do not have `npm` installed, you can always install the prebuilt binaries
$ wget -q https://appwrite.io/cli/install.sh -O - | /bin/bash
```

### MacOS via [Homebrew](https://brew.sh)
### MacOS / Linux via [Homebrew](https://brew.sh)
```bash
$ brew install appwrite
$ brew install appwrite/appwrite/appwrite
```

Homebrew installs the native binary for your platform.
Homebrew pulls the formula from the [`appwrite/homebrew-appwrite`](https://github.com/appwrite/homebrew-appwrite) tap and downloads the native binary for your platform.

### Windows
Via Powershell
Expand All @@ -62,7 +62,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
Once the installation completes, you can verify your install using
```
$ appwrite -v
18.2.0
19.0.0
```

## Getting Started
Expand Down
Loading
Loading