-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (46 loc) · 1.75 KB
/
react-native-release.yml
File metadata and controls
51 lines (46 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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