React Native Release #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: React Native Release | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'The package version to use e.g. 1.80.0' | |
| required: true | |
| type: string | |
| jobs: | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| env: | |
| VERSION: ${{ github.event.inputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Javascript | |
| uses: ./.github/actions/javascript-setup | |
| - name: Get Capture SDK version | |
| id: capture-sdk | |
| run: | | |
| CAPTURE_SDK_VERSION=$(node -p "require('./packages/react-native/package.json').captureSdkVersion") | |
| echo "version=$CAPTURE_SDK_VERSION" >> $GITHUB_OUTPUT | |
| - name: Prepare release | |
| run: | | |
| npm version --workspace @bitdrift/react-native $VERSION | |
| npx nx prepare-release @bitdrift/react-native | |
| - name: Publish release | |
| run: npm publish ./dist/react-native --provenance | |
| - name: Create a PR with the updated version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CAPTURE_SDK_VERSION: ${{ steps.capture-sdk.outputs.version }} | |
| run: | | |
| git config user.name github-actions | |
| git config user.email github-actions@github.com | |
| git checkout -b release-rn-$VERSION | |
| git add packages/react-native/package.json package-lock.json | |
| git commit -m "chore: release react-native $VERSION (capture-sdk $CAPTURE_SDK_VERSION)" | |
| git push --set-upstream origin release-rn-$VERSION | |
| gh pr create --title "chore: release react-native $VERSION" --body "v$VERSION (capture-sdk v$CAPTURE_SDK_VERSION)" --base main --head release-rn-$VERSION | |
| gh pr merge --auto -r |