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
35 changes: 35 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,38 @@ build-swift-package: build

test-swift-package: build
$(call XCODEBUILD_CMD, test)

release:
@echo "--- :rocket: Starting GutenbergKit Release Process"
@echo "Usage: make release VERSION_TYPE=[<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] [DRY_RUN=true]"
@echo ""
@echo "Version Types:"
@echo " <newversion> Custom version number (e.g., 1.2.3)"
@echo " major Increment major version (1.0.0 -> 2.0.0)"
@echo " minor Increment minor version (1.2.0 -> 1.3.0)"
@echo " patch Increment patch version (1.2.3 -> 1.2.4)"
@echo " premajor Increment major version and add prerelease (1.2.3 -> 2.0.0-alpha.0)"
@echo " preminor Increment minor version and add prerelease (1.2.3 -> 1.3.0-alpha.0)"
@echo " prepatch Increment patch version and add prerelease (1.2.3 -> 1.2.4-alpha.0)"
@echo " prerelease Increment prerelease version (1.2.3-alpha.0 -> 1.2.3-alpha.1)"
@echo " from-git Use version from git tag"
@echo ""
@echo "Examples:"
@echo " make release VERSION_TYPE=patch"
@echo " make release VERSION_TYPE=minor"
@echo " make release VERSION_TYPE=major"
@echo " make release VERSION_TYPE=1.2.3"
@echo " make release VERSION_TYPE=premajor"
@echo " make release VERSION_TYPE=prerelease"
@echo " make release VERSION_TYPE=patch DRY_RUN=true"
@echo ""
@if [ -z "$(VERSION_TYPE)" ]; then \
echo "Error: VERSION_TYPE is required."; \
echo "Use one of: <newversion>, major, minor, patch, premajor, preminor, prepatch, prerelease, from-git"; \
exit 1; \
fi
@if [ "$(DRY_RUN)" = "true" ]; then \
./bin/release.sh $(VERSION_TYPE) --dry-run; \
else \
./bin/release.sh $(VERSION_TYPE); \
fi
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ make build

Once finished, the Swift and Kotlin packages are ready to publish. Consuming iOS or Android host apps can then include the GutenbergKit package as a dependency.

## Releases

See the [release documentation](./docs/releases.md) for more information.

## Remote Editor

By default, GutenbergKit utilizes local `@wordpress` modules. This approach is similar to most modern web applications, where the `@wordpress` modules are bundled with the application.
Expand Down
94 changes: 94 additions & 0 deletions bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Bin Directory

This directory contains utility scripts for the GutenbergKit project.

## Scripts

### `release.sh`

Automates the GutenbergKit release process. This script performs all the steps outlined in the [release documentation](../docs/releases.md).

#### Usage

```bash
# Direct usage
./bin/release.sh [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] [--dry-run]

# Via Makefile (recommended)
make release VERSION_TYPE=[<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] [DRY_RUN=true]
```

#### Version Types

| Type | Description | Example |
| -------------- | ------------------------------- | --------------------------------- |
| `major` | Increment major version | `1.2.3` → `2.0.0` |
| `minor` | Increment minor version | `1.2.3` → `1.3.0` |
| `patch` | Increment patch version | `1.2.3` → `1.2.4` |
| `premajor` | Increment major with prerelease | `1.2.3` → `2.0.0-alpha.0` |
| `preminor` | Increment minor with prerelease | `1.2.3` → `1.3.0-alpha.0` |
| `prepatch` | Increment patch with prerelease | `1.2.3` → `1.2.4-alpha.0` |
| `prerelease` | Increment prerelease version | `1.2.3-alpha.0` → `1.2.3-alpha.1` |
| `from-git` | Use version from git tag | Uses latest git tag |
| `<newversion>` | Set specific version | `1.2.3` → `1.2.3` |

#### Examples

```bash
# Standard releases
make release VERSION_TYPE=patch
make release VERSION_TYPE=minor
make release VERSION_TYPE=major

# Custom version
make release VERSION_TYPE=1.2.3

# Prerelease versions
make release VERSION_TYPE=premajor
make release VERSION_TYPE=preminor
make release VERSION_TYPE=prepatch
make release VERSION_TYPE=prerelease

# Use version from git tag
make release VERSION_TYPE=from-git

# Test without making changes
make release VERSION_TYPE=patch DRY_RUN=true
```

#### What it does

1. **Pre-flight checks:**

- Verifies you're on the `trunk` branch
- Checks that your working directory is clean
- Ensures required dependencies are installed (`gh`, `npm`, `make`)

2. **Release process:**
- Increments the version number in `package.json`
- Builds the project using `make build`
- Commits all changes with the version number as the commit message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's going to make commits, it probably shouldn't do it while we are on trunk. The way this is handled for app releases is that the scripts would create a release/x.y.z branch and make the changes there. The tag is also created from this branch. Once it's done, it'd create a PR against trunk.

Copy link
Member Author

@dcalhoun dcalhoun Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's going to make commits, it probably shouldn't do it while we are on trunk. The way this is handled for app releases is that the scripts would create a release/x.y.z branch and make the changes there. The tag is also created from this branch. Once it's done, it'd create a PR against trunk.

I agree. I consider the use of the trunk branch for this as a temporary solution—ideally, a short one—for avoiding PRs that create a large amount of noise due to the current VCS tracking of iOS build output.

This is what I attempted to convey in the PR description:

The trunk branch is used for simplicity while iOS builds are still manually created and committed. Long term, we should perform that with CI tasks and remove the ability for repository admins from pushing directly to origin/trunk.

- Creates a git tag with the version number
- Pushes changes to `origin/trunk` with tags
- Creates a GitHub release with auto-generated notes

#### Dependencies

- `gh` (GitHub CLI) - for creating GitHub releases
- `npm` - for version management and building
- `make` - for building the project
- Git - for version control operations

### `prep-translations.js`

Prepares translations for the GutenbergKit project. This script is typically run as part of the build process.

#### Usage

```bash
# Direct usage
node bin/prep-translations.js

# Via npm script
npm run prep-translations
```
Loading