Release the plugin SDK as a package file
pnpm release:sdk now packs runestone-plugin-sdk-<version>.tgz and sdk.json into releases/plugin-sdk/<version>/. Plugins install the SDK from the URL of that file on the RuneStone releases page. The script no longer uses a clone of a separate SDK repository. Installers, browser engine ZIPs, and SDK packages now share the RuneStone releases page.
This commit is contained in:
+37
-44
@@ -14,7 +14,7 @@ RuneStone, the browser engine, and each plugin keep separate version numbers. Ea
|
||||
| `yy` | A deliberate release that is ready for build testing, by direction of the project owner | `xx` to zero |
|
||||
| `zz` | A full release, by direction of the project owner | `yy` and `xx` to zero |
|
||||
|
||||
A build is a RuneStone installer, a browser engine ZIP, or a plugin ZIP, unless the project owner asks for a different distributable.
|
||||
A build is a RuneStone installer, a browser engine ZIP, an SDK package, or a plugin ZIP, unless the project owner asks for a different distributable.
|
||||
Development servers, test runs, and intermediate compilation output are not builds.
|
||||
|
||||
- Keep routine implementation work in the current `zz.yy` series.
|
||||
@@ -69,6 +69,7 @@ These rules apply to the main app, all existing plugins, and all new plugins.
|
||||
| --- | --- |
|
||||
| RuneStone installer | `releases/<version>/` at the RuneStone project root |
|
||||
| Browser engine ZIP | `releases/browser-engine/<version>/` at the RuneStone project root |
|
||||
| SDK package | `releases/plugin-sdk/<version>/` at the RuneStone project root |
|
||||
| Plugin ZIP | `releases/` at the root of that plugin project |
|
||||
|
||||
- Keep release notes, checksums, and build metadata with the release they describe, in the local release folder.
|
||||
@@ -82,15 +83,15 @@ These rules apply to the main app, all existing plugins, and all new plugins.
|
||||
- Report a filename conflict before you change a file name.
|
||||
- After each completed build, report the full path of the build file.
|
||||
|
||||
`pnpm build:installer`, `pnpm build:browser-engine`, and `pnpm package:plugin` obey these rules for their own output.
|
||||
The installer and engine scripts stop if the release file exists. The plugin packager reuses an identical ZIP and stops if the existing ZIP has different contents.
|
||||
`pnpm build:installer`, `pnpm build:browser-engine`, `pnpm release:sdk`, and `pnpm package:plugin` obey these rules for their own output.
|
||||
The installer, engine, and SDK scripts stop if the release file exists. The plugin packager reuses an identical ZIP and stops if the existing ZIP has different contents.
|
||||
|
||||
## Publish an installer
|
||||
|
||||
Publish RuneStone installers on the [public releases page](https://git.knottywyvern.com/kwyvern/RuneStone_Releases/releases), beside the browser engine ZIPs.
|
||||
Publish RuneStone installers on the [RuneStone releases page](https://git.knottywyvern.com/kwyvern/RuneStone/releases). Browser engine ZIPs and SDK packages use the same page.
|
||||
|
||||
1. Build the installer and complete the [installer checks](builds.md#installer-checks).
|
||||
2. Create a release with the tag `v<version>`.
|
||||
2. Create a release with the tag `v<version>` on the commit that sets the version.
|
||||
3. Attach only installer binaries.
|
||||
4. Leave the release description empty.
|
||||
5. Publish the release.
|
||||
@@ -105,14 +106,13 @@ Keep the other build records in the local release folder.
|
||||
|
||||
## Publish a browser engine
|
||||
|
||||
Each host build downloads the URL in its pin, so the engine ZIP needs a public release location that answers without a sign-in.
|
||||
Until that location exists, the pin stays empty, and an installer cannot download the engine.
|
||||
Each host build downloads the URL in its pin, so the engine ZIP must download without a sign-in.
|
||||
|
||||
1. Build the engine ZIP with the URL of its public release folder. See [Build the browser engine](builds.md#build-the-browser-engine).
|
||||
2. In the public release location, create a release with the tag `browser-engine-v<version>`.
|
||||
3. Attach only the engine ZIP. Leave the release description empty. The ZIP is about 164 MB, so the location must accept files of that size.
|
||||
4. Make sure that the `url` in `engine.json` downloads the ZIP without a sign-in, and that its size matches.
|
||||
5. Commit `src-tauri/browser-engine.json` and the engine version fields.
|
||||
1. Build the engine ZIP with the URL of its release folder on the RuneStone releases page. See [Build the browser engine](builds.md#build-the-browser-engine).
|
||||
2. Commit `src-tauri/browser-engine.json` and the engine version fields.
|
||||
3. Create a release with the tag `browser-engine-v<version>` on that commit.
|
||||
4. Attach only the engine ZIP. Leave the release description empty. The ZIP is about 164 MB, so the server must accept files of that size.
|
||||
5. Make sure that the `url` in `engine.json` downloads the ZIP without a sign-in, and that its size matches.
|
||||
6. Build the installer that pins this engine.
|
||||
|
||||
Keep each published engine ZIP. Installed RuneStone versions download the engine that they pin.
|
||||
@@ -171,50 +171,43 @@ For GitHub publication steps, see [GitHub's release instructions](https://docs.g
|
||||
|
||||
## SDK releases
|
||||
|
||||
The plugin SDK `@runestone/plugin-sdk` has its own version, in `packages/plugin-sdk/package.json`. The first release is `0.1.0`.
|
||||
The plugin SDK `@runestone/plugin-sdk` has its own version, in `packages/plugin-sdk/package.json`.
|
||||
The [version rules](#versions) and the [hotfix rules](#hotfix-versions) apply.
|
||||
An SDK release is a commit and a tag in the public SDK repository. It is not a ZIP or an installer.
|
||||
An SDK release is one package file, `runestone-plugin-sdk-<version>.tgz`, on the RuneStone releases page with the tag `plugin-sdk-v<version>`.
|
||||
Plugin authors install the SDK from the URL of that file. See [Install the SDK](plugin-development.md#install-the-sdk).
|
||||
`pnpm sdk:build` output in `packages/plugin-sdk/dist/` is compilation output, not a release.
|
||||
|
||||
The source stays in this repository. The public repository is [RuneStone_Plugin_SDK](https://git.knottywyvern.com/kwyvern/RuneStone_Plugin_SDK).
|
||||
It holds only the released files: `dist/`, `package.json`, `README.md`, `LICENSE`, and `NOTICE`.
|
||||
Plugin authors install the SDK from a tag of that repository. See [Install the SDK](plugin-development.md#install-the-sdk).
|
||||
|
||||
### Prepare the clone
|
||||
|
||||
Do these steps one time.
|
||||
|
||||
1. On the Gitea server, create the public repository `kwyvern/RuneStone_Plugin_SDK`. It can be empty.
|
||||
2. Clone it beside the RuneStone repository, as `RuneStone_Plugin_SDK`.
|
||||
For a different folder, set `RUNESTONE_SDK_REPO` to the clone.
|
||||
Without that variable, the script uses `RuneStone_Plugin_SDK` in the `RUNESTONE_PLUGIN_REPOS` folder, or else in the parent folder of RuneStone.
|
||||
3. Set the Git user name and email in the clone, if your global Git configuration does not have them.
|
||||
|
||||
### Release the SDK
|
||||
|
||||
1. Commit the SDK changes in RuneStone. Run `pnpm check` and `pnpm test`.
|
||||
2. In the clone, get the latest commits and tags: `git pull --tags`.
|
||||
3. Run `pnpm release:sdk --version <version> --dry-run`. Read the plan.
|
||||
4. Run `pnpm release:sdk --version <version>`.
|
||||
5. Run the push commands that the script prints. The script never pushes.
|
||||
6. In RuneStone, commit the new version in `packages/plugin-sdk/package.json`.
|
||||
7. Install the tag in a plugin project, build the plugin, and test it in RuneStone.
|
||||
2. Run `pnpm release:sdk --release-url <folder URL> --version <version> --dry-run`. Read the plan.
|
||||
The folder URL is the download folder of the release, for example `https://git.knottywyvern.com/kwyvern/RuneStone/releases/download/plugin-sdk-v0.1.2`.
|
||||
3. Run the same command without `--dry-run`.
|
||||
4. On the RuneStone releases page, create a release with the tag `plugin-sdk-v<version>` on the `source` commit in `sdk.json`.
|
||||
5. Attach only the `.tgz` file. Leave the release description empty.
|
||||
6. Make sure that the `url` in `sdk.json` downloads the file without a sign-in, and that its SHA-256 matches.
|
||||
7. Commit the new version in `packages/plugin-sdk/package.json`.
|
||||
|
||||
The script builds the SDK, then replaces the released files in the clone. It commits them with the RuneStone commit in the message.
|
||||
Then it creates the annotated tag `v<version>`.
|
||||
The new version goes into `packages/plugin-sdk/package.json` only after the tag exists.
|
||||
If a step fails, the script restores that version field. It also resets the clone to its commit before the attempt.
|
||||
The script builds the SDK and writes two files in `releases/plugin-sdk/<version>/`:
|
||||
|
||||
| File | Contents |
|
||||
| --- | --- |
|
||||
| `runestone-plugin-sdk-<version>.tgz` | The package: `dist/`, `package.json`, `README.md`, `LICENSE`, and `NOTICE`, in a `package/` folder |
|
||||
| `sdk.json` | The URL, the size, the SHA-256, the npm integrity value, and the source commit |
|
||||
|
||||
The package files have a fixed time and mode, so the same files give the same package bytes.
|
||||
The new version goes into `packages/plugin-sdk/package.json` only after both files exist.
|
||||
If a step fails, the script restores that version field and removes the files of that attempt.
|
||||
|
||||
The script stops before it changes a file in these conditions:
|
||||
|
||||
| Condition | Action |
|
||||
| --- | --- |
|
||||
| The version is not greater than the version in `packages/plugin-sdk/package.json` or in the clone | Give a greater version. |
|
||||
| The version is not greater than the version in `packages/plugin-sdk/package.json` | Give a greater version. |
|
||||
| `packages/plugin-sdk/` has no `LICENSE` or `README.md` file | Add the file. The SDK uses the Apache License 2.0. |
|
||||
| `packages/plugin-sdk/` has changes that are not committed | Commit them, so that the release has a source commit. |
|
||||
| The clone is missing or is not the root of a Git repository | Clone the public repository, or set `RUNESTONE_SDK_REPO`. |
|
||||
| The clone has changes, or it is not on a branch | Commit or remove the changes. Check out the release branch. |
|
||||
| The tag `v<version>` exists in the clone | Give a new version. Never move or replace a published tag. |
|
||||
| The release URL is not HTTPS, or it has credentials, a query, or a fragment | Give the plain HTTPS URL of the release folder. |
|
||||
| A file exists in `releases/plugin-sdk/<version>/` | Give a new version. Never replace a published package. |
|
||||
|
||||
The tag is the release. Do not attach files to a repository release for the SDK, and do not put SDK files in `releases/`.
|
||||
To move the SDK to another service, or to mirror it, push the same commits and tags. Plugin authors then change only the repository URL.
|
||||
Keep each published SDK package unchanged. A plugin lock file records the integrity value of the package, so a different file at the same URL stops its installation.
|
||||
To move the SDK to another service, upload the same files there. Plugin authors then change only the URL.
|
||||
|
||||
Reference in New Issue
Block a user