From 966e12f068ebd4716837922f3708d209dd1ec656 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Fri, 31 Jan 2025 15:21:30 +0100 Subject: [PATCH 1/2] docs: add release docs --- README.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/README.md b/README.md index 6e484bf..d9ebbf1 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,85 @@ in [example/src/App.tsx]. See the [contributing guide] to learn about the development and contribution workflow. +## Making a release + +Ensure you have `gh`, the [GitHub CLI](https://cli.github.com/) client, installed and +authenticate it. + +```sh +gh auth login +``` + +Start a release build. + +```sh +gh workflow run build-release.yml +``` + +Grab a _huuuuge_ cup of coffee and check the run status. + +```sh +gh run list --workflow=build-release.yml --branch main +``` + +If the run succeeded, copy its ID. If it is the latest run, you can also get the ID +programmatically. + +```sh +RUN_ID=$(gh run list --workflow build-release.yml --branch main --limit 1 --json databaseId --jq ".[0].databaseId") +``` + +Download the build artifacts. + +```sh +gh run download $RUN_ID --name android-libs --dir ? +gh run download $RUN_ID --name xcframework --dir ? +``` + +TODO: extract? + +Test the downloaded binaries locally by building and running the example app on +both platforms. + +```sh +yarn example start +``` + +Build the npm package in a dry run and verify the contained files. Most importantly the +large binary files should be present. + +```sh +npm pack --dry-run +``` + +Create and push a tag for the release. + +```sh +git tag $TAG +git push --tags +``` + +Create the release from the new tag. + +```sh +gh release create $TAG --notes "Changelog: https://github.com/unomed-dev/react-native-matrix-sdk/compare/$PREVIOUS_TAG...$TAG" +``` + +TODO: compress? + +Upload the binaries to the release. + +```sh +gh release upload $RELEASE ... --clobber +``` + +Publish the release on npmjs.com. + +```sh +npm publish --access public +``` + + ## License Apache-2.0 @@ -75,6 +154,7 @@ Apache-2.0 [contributing guide]: CONTRIBUTING.md [create-react-native-library]: https://github.com/callstack/react-native-builder-bob [example/src/App.tsx]: example/src/App.tsx +[GitHub CLI]: https://cli.github.com/ [matrix-rust-sdk]: https://github.com/matrix-org/matrix-rust-sdk [npm registry]: https://www.npmjs.com/package/@unomed/react-native-matrix-sdk [src/index.ts]: src/index.ts From ff385d0af01951fda8338bc29ee0ab109858c482 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Fri, 31 Jan 2025 15:38:33 +0100 Subject: [PATCH 2/2] fix: fill out missing steps --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d9ebbf1..fc6d480 100644 --- a/README.md +++ b/README.md @@ -98,12 +98,10 @@ RUN_ID=$(gh run list --workflow build-release.yml --branch main --limit 1 --json Download the build artifacts. ```sh -gh run download $RUN_ID --name android-libs --dir ? -gh run download $RUN_ID --name xcframework --dir ? +rm -rf android/src/main/jniLibs && gh run download $RUN_ID --name android-libs --dir android +rm -rf build/*.xcframework && gh run download $RUN_ID --name xcframework --dir build ``` -TODO: extract? - Test the downloaded binaries locally by building and running the example app on both platforms. @@ -112,7 +110,7 @@ yarn example start ``` Build the npm package in a dry run and verify the contained files. Most importantly the -large binary files should be present. +large binary files should *not* be present. ```sh npm pack --dry-run @@ -131,12 +129,17 @@ Create the release from the new tag. gh release create $TAG --notes "Changelog: https://github.com/unomed-dev/react-native-matrix-sdk/compare/$PREVIOUS_TAG...$TAG" ``` -TODO: compress? +Compress the binaries into archives. + +```sh +zip android-libs.zip android/**/*.a +zip -r xcframework.zip build/*.xcframework +``` Upload the binaries to the release. ```sh -gh release upload $RELEASE ... --clobber +gh release upload $RELEASE android-libs.zip xcframework.zip --clobber ``` Publish the release on npmjs.com.