Skip to content

Conversation

@j-piasecki
Copy link
Member

@j-piasecki j-piasecki commented Oct 28, 2025

Description

Implements automated release scripts for the repository.

A new nightly release should be triggered on every commit pushed to the main branch. Version resolution happens automatically - the latest tag is pulled from npm, 1 is added to the minor, and the patch is set to 0. The full version is $major.$minor$.$patch-$year$month$day-$sha.

To release a stable version, cut a branch with the name matching format of $major.$minor-stable and trigger the publish-stable-release on that branch. By default, it does a dry run, skipping publishing the package and committing changes. Use that to make sure everything is correct before an actual release. It also uploads the package that would've been published as a GitHub artifact, which could be useful for testing. Version resolution happens automatically:

  • the major and minor are inferred from the branch name
  • next patch name is figured out from npm, in the dumbest possible way - iteratively check the patch versions until a not-released one is found
  • if the minor is exactly +1 compared to the latest and the patch is 0 or the minor matches the latest and the patch is +1, the release is tagged as latest

In the future, we may want to run static checks automatically and app builds before releasing, but that would require refactoring our CI to rely more on reusable workflows.

Test plan

Tested on a fork.
Release commitly run: https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902148546/job/53951686147 (failed on publish due to missing provenance)

Release stable run for existing version: https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902287389/job/53952137361 (this one succeeded because I commented out npm publish and replaced it with echo)

And here is the created release commit: j-piasecki@211296a. You can notice that the tag was also created successfully.

Release stable run for a new version: https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18903154587/job/53954932559 (this one was a dry run).

@j-piasecki j-piasecki marked this pull request as ready for review October 29, 2025 09:35
Copy link
Contributor

@m-bert m-bert left a comment

Choose a reason for hiding this comment

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

Should be fine, remember to change workflow in npm settings 😅

@j-piasecki j-piasecki merged commit c99169d into main Oct 30, 2025
@j-piasecki j-piasecki deleted the @jpiasecki/overhaul-releases branch October 30, 2025 13:22
j-piasecki added a commit that referenced this pull request Oct 30, 2025
## Description


#3784
added new release scripts, but there was a leftover workflow for
releasing a commitly. This PR gets rid of it.

I also noticed that the `homepage` field in package.json points to our
readme instead of the docs, so I changed that.

Finally, I added `paths` filter to the release workflow, so changes only
affecting docs, example apps, or scripts won't trigger a release.

## Test plan

The failed job got removed. As for the other change -
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushpull_requestpull_request_targetpathspaths-ignore.

> If you define both branches/branches-ignore and paths/paths-ignore,
the workflow will only run when both filters are satisfied.
j-piasecki added a commit that referenced this pull request Nov 3, 2025
## Description

Implements automated release scripts for the repository.

A new nightly release should be triggered on every commit pushed to the
`main` branch. Version resolution happens automatically - the `latest`
tag is pulled from npm, 1 is added to the minor, and the patch is set to
0. The full version is `$major.$minor$.$patch-$year$month$day-$sha`.

To release a stable version, cut a branch with the name matching format
of `$major.$minor-stable` and trigger the `publish-stable-release` on
that branch. By default, it does a dry run, skipping publishing the
package and committing changes. Use that to make sure everything is
correct before an actual release. It also uploads the package that
would've been published as a GitHub artifact, which could be useful for
testing. Version resolution happens automatically:
- the major and minor are inferred from the branch name
- next patch name is figured out from npm, in the dumbest possible way -
iteratively check the patch versions until a not-released one is found
- if the minor is exactly +1 compared to the latest and the patch is 0
or the minor matches the latest and the patch is +1, the release is
tagged as latest

In the future, we may want to run static checks automatically and app
builds before releasing, but that would require refactoring our CI to
rely more on reusable workflows.

## Test plan

Tested on a fork.
Release commitly run:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902148546/job/53951686147
(failed on publish due to missing provenance)

Release stable run for existing version:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902287389/job/53952137361
(this one succeeded because I commented out `npm publish` and replaced
it with `echo`)

And here is the created release commit:
j-piasecki@211296a.
You can notice that the tag was also created successfully.

Release stable run for a new version:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18903154587/job/53954932559
(this one was a dry run).
j-piasecki added a commit that referenced this pull request Nov 3, 2025
## Description


#3784
added new release scripts, but there was a leftover workflow for
releasing a commitly. This PR gets rid of it.

I also noticed that the `homepage` field in package.json points to our
readme instead of the docs, so I changed that.

Finally, I added `paths` filter to the release workflow, so changes only
affecting docs, example apps, or scripts won't trigger a release.

## Test plan

The failed job got removed. As for the other change -
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushpull_requestpull_request_targetpathspaths-ignore.

> If you define both branches/branches-ignore and paths/paths-ignore,
the workflow will only run when both filters are satisfied.
j-piasecki added a commit that referenced this pull request Nov 20, 2025
## Description

Implements automated release scripts for the repository.

A new nightly release should be triggered on every commit pushed to the
`main` branch. Version resolution happens automatically - the `latest`
tag is pulled from npm, 1 is added to the minor, and the patch is set to
0. The full version is `$major.$minor$.$patch-$year$month$day-$sha`.

To release a stable version, cut a branch with the name matching format
of `$major.$minor-stable` and trigger the `publish-stable-release` on
that branch. By default, it does a dry run, skipping publishing the
package and committing changes. Use that to make sure everything is
correct before an actual release. It also uploads the package that
would've been published as a GitHub artifact, which could be useful for
testing. Version resolution happens automatically:
- the major and minor are inferred from the branch name
- next patch name is figured out from npm, in the dumbest possible way -
iteratively check the patch versions until a not-released one is found
- if the minor is exactly +1 compared to the latest and the patch is 0
or the minor matches the latest and the patch is +1, the release is
tagged as latest

In the future, we may want to run static checks automatically and app
builds before releasing, but that would require refactoring our CI to
rely more on reusable workflows.

## Test plan

Tested on a fork.
Release commitly run:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902148546/job/53951686147
(failed on publish due to missing provenance)

Release stable run for existing version:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18902287389/job/53952137361
(this one succeeded because I commented out `npm publish` and replaced
it with `echo`)

And here is the created release commit:
j-piasecki@211296a.
You can notice that the tag was also created successfully.

Release stable run for a new version:
https://github.com/j-piasecki/react-native-gesture-handler/actions/runs/18903154587/job/53954932559
(this one was a dry run).
j-piasecki added a commit that referenced this pull request Nov 20, 2025
## Description


#3784
added new release scripts, but there was a leftover workflow for
releasing a commitly. This PR gets rid of it.

I also noticed that the `homepage` field in package.json points to our
readme instead of the docs, so I changed that.

Finally, I added `paths` filter to the release workflow, so changes only
affecting docs, example apps, or scripts won't trigger a release.

## Test plan

The failed job got removed. As for the other change -
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushpull_requestpull_request_targetpathspaths-ignore.

> If you define both branches/branches-ignore and paths/paths-ignore,
the workflow will only run when both filters are satisfied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants