From 61c507e94b479fe3ba1d3733689890d17b8b7276 Mon Sep 17 00:00:00 2001 From: Gregory Moskaliuk Date: Thu, 21 May 2026 14:39:36 +0200 Subject: [PATCH 1/2] chore: add npm publish workflow with nightly releases --- .github/workflows/publish-release.yml | 71 +++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..43824ba --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,71 @@ +name: Publish release to npm +on: + # For nightly releases + schedule: + - cron: '27 23 * * *' # at 23:27 every day + # For manual releases + workflow_dispatch: + inputs: + release-type: + description: Type of release to publish. + type: choice + options: + - stable + - nightly + - beta + - rc + default: stable + version: + description: Specific version to publish (usually inferred from x.y-stable branch name). + type: string + required: false + default: '' + dry-run: + description: Whether to perform a dry run of the publish. + type: boolean + default: true + +jobs: + npm-build: + if: github.repository == 'software-mansion-labs/react-native-streamdown' + runs-on: ubuntu-latest + + permissions: + contents: write + id-token: write # for OIDC + + concurrency: + group: publish-${{ github.ref }} + cancel-in-progress: false + + steps: + - name: Check out + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'yarn' + registry-url: https://registry.npmjs.org/ + + - name: Publish manual release + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: software-mansion-labs/npm-package-publish@main + with: + package-name: 'react-native-streamdown' + package-json-path: 'package.json' + install-dependencies-command: 'YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install' + release-type: ${{ inputs.release-type }} + version: ${{ inputs.version }} + dry-run: ${{ inputs.dry-run }} + + - name: Publish automatic nightly release + if: ${{ github.event_name == 'schedule' }} + uses: software-mansion-labs/npm-package-publish@main + with: + package-name: 'react-native-streamdown' + package-json-path: 'package.json' + install-dependencies-command: 'YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install' + release-type: 'nightly' + dry-run: false From 3e68808f3176c9768c90b480c6ffb7fc862000a8 Mon Sep 17 00:00:00 2001 From: Gregory Moskaliuk Date: Thu, 21 May 2026 14:41:07 +0200 Subject: [PATCH 2/2] chore: add manual npm publish workflow --- .github/workflows/publish-release.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 43824ba..b39adf5 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,9 +1,5 @@ name: Publish release to npm on: - # For nightly releases - schedule: - - cron: '27 23 * * *' # at 23:27 every day - # For manual releases workflow_dispatch: inputs: release-type: @@ -49,8 +45,7 @@ jobs: cache: 'yarn' registry-url: https://registry.npmjs.org/ - - name: Publish manual release - if: ${{ github.event_name == 'workflow_dispatch' }} + - name: Publish release uses: software-mansion-labs/npm-package-publish@main with: package-name: 'react-native-streamdown' @@ -60,12 +55,3 @@ jobs: version: ${{ inputs.version }} dry-run: ${{ inputs.dry-run }} - - name: Publish automatic nightly release - if: ${{ github.event_name == 'schedule' }} - uses: software-mansion-labs/npm-package-publish@main - with: - package-name: 'react-native-streamdown' - package-json-path: 'package.json' - install-dependencies-command: 'YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install' - release-type: 'nightly' - dry-run: false