Skip to content

Commit 578cae5

Browse files
committed
Merge branch 'main' into @szymczak/fix-text-selection
2 parents 1de5ba2 + cec2fea commit 578cae5

40 files changed

+32189
-24522
lines changed

.github/OSBotify-private-key.asc.gpg

-3.85 KB
Binary file not shown.

.github/workflows/build-android.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
java-version: 17
4545

4646
- name: Install node_modules
47-
run: yarn install --immutable
47+
run: npm ci
4848

4949
- name: Build app
5050
working-directory: example/android

.github/workflows/build-ios.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
path: |
4444
node_modules
4545
example/node_modules
46-
key: build-ios-node-modules-${{ matrix.react-native-architecture }}-${{ hashFiles('yarn.lock') }}
46+
key: build-ios-node-modules-${{ matrix.react-native-architecture }}-${{ hashFiles('package-lock.json') }}
4747
restore-keys: build-ios-node-modules-${{ matrix.react-native-architecture }}-
4848

4949
- name: Install node_modules
50-
run: yarn install --immutable
50+
run: npm ci
5151

5252
- name: Restore Pods from cache
5353
uses: actions/cache@v4
@@ -56,7 +56,7 @@ jobs:
5656
example/ios/Pods
5757
~/Library/Caches/CocoaPods
5858
~/.cocoapods
59-
key: build-ios-pods-${{ matrix.react-native-architecture }}-${{ hashFiles('example/node_modules/react-native/package.json') }}
59+
key: build-ios-pods-${{ matrix.react-native-architecture }}-${{ hashFiles('node_modules/react-native/package.json') }}
6060
restore-keys: build-ios-pods-${{ matrix.react-native-architecture }}-
6161

6262
- name: Install Pods
@@ -75,7 +75,7 @@ jobs:
7575
uses: actions/cache@v4
7676
with:
7777
path: ~/Library/Developer/Xcode/DerivedData
78-
key: build-ios-derived-data-${{ matrix.react-native-architecture }}-${{ hashFiles('example/node_modules/react-native/package.json') }}
78+
key: build-ios-derived-data-${{ matrix.react-native-architecture }}-${{ hashFiles('node_modules/react-native/package.json') }}
7979
restore-keys: build-ios-derived-data-${{ matrix.react-native-architecture }}-
8080

8181
- name: Build app

.github/workflows/build-web.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v4
2929

3030
- name: Install node_modules
31-
run: yarn install --immutable
31+
run: npm ci
3232

3333
- name: Build app
3434
working-directory: WebExample

.github/workflows/check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,32 @@ jobs:
2525
node-version: 18
2626

2727
- name: Install node_modules
28-
run: yarn install --immutable
28+
run: npm ci
2929

3030
- name: Verify there's no parser diff
3131
working-directory: parser
3232
run: |
33-
yarn build
33+
npm run build
3434
if ! git diff --name-only --exit-code; then
3535
# shellcheck disable=SC2016
36-
echo 'Error: Parser diff detected! Please run `cd parser && yarn build` and commit the changes.'
36+
echo 'Error: Parser diff detected! Please run `cd parser && npm run build` and commit the changes.'
3737
exit 1
3838
fi
3939
4040
- name: Typecheck library
41-
run: yarn tsc --project tsconfig.json --noEmit
41+
run: npm run typecheck -- --project tsconfig.json
4242

4343
- name: Typecheck parser
44-
run: yarn tsc --project parser/tsconfig.json --noEmit
44+
run: npm run typecheck -- --project parser/tsconfig.json
4545

4646
- name: Typecheck example app
47-
run: yarn tsc --project example/tsconfig.json --noEmit
47+
run: npm run typecheck -- --project example/tsconfig.json
4848

4949
- name: Typecheck WebExample app
50-
run: yarn tsc --project WebExample/tsconfig.json --noEmit
50+
run: npm run typecheck -- --project WebExample/tsconfig.json
5151

5252
- name: Lint
53-
run: yarn lint
53+
run: npm run lint
5454

5555
- name: Test
56-
run: yarn test
56+
run: npm run test

.github/workflows/lint.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
name: Lint JavaScript
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize]
4+
pull_request:
5+
types: [opened, synchronize]
66

77
jobs:
8-
lint:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v2
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
1212

13-
- uses: actions/cache@v2
14-
with:
15-
path: ~/.yarn
16-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
17-
restore-keys: |
18-
${{ runner.os }}-yarn-
13+
- uses: actions/cache@v2
14+
with:
15+
path: ~/.npm
16+
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
17+
restore-keys: |
18+
${{ runner.os }}-npm-
1919
20-
- name: Setup Node
21-
uses: actions/setup-node@v1
22-
with:
23-
node-version: "16.x"
20+
- name: Setup Node
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: '16.x'
2424

25-
- name: Install node_modules
26-
run: yarn install --immutable
25+
- name: Install node_modules
26+
run: npm ci
2727

28-
- name: Verify there's no Prettier diff
29-
run: |
30-
yarn lint --fix --quiet
31-
if ! git diff --name-only --exit-code; then
32-
# shellcheck disable=SC2016
33-
echo 'Error: Prettier diff detected! Please run `yarn lint --fix` and commit the changes.'
34-
exit 1
35-
fi
28+
- name: Verify there's no Prettier diff
29+
run: |
30+
npm run lint -- --fix --quiet
31+
if ! git diff --name-only --exit-code; then
32+
# shellcheck disable=SC2016
33+
echo 'Error: Prettier diff detected! Please run `npm run lint -- --fix` and commit the changes.'
34+
exit 1
35+
fi

.github/workflows/publish.yml

Lines changed: 10 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,18 @@
11
name: Publish package to npmjs
22

3-
# This workflow runs when code is pushed to `main` (i.e: when a pull request is merged)
43
on:
5-
push:
6-
branches: [main]
4+
push:
5+
branches: [main]
76

8-
# Ensure that only once instance of this workflow executes at a time.
7+
# Ensure that only one instance of this workflow executes at a time.
98
# If multiple PRs are merged in quick succession, there will only ever be one publish workflow running and one pending.
109
concurrency: ${{ github.workflow }}
1110

1211
jobs:
13-
version:
14-
runs-on: ubuntu-latest
15-
16-
# OSBotify will update the version on `main`, so this check is important to prevent an infinite loop
17-
if: ${{ github.actor != 'OSBotify' }}
18-
19-
steps:
20-
- uses: actions/checkout@v4
21-
with:
22-
ref: main
23-
# The OS_BOTIFY_COMMIT_TOKEN is a personal access token tied to osbotify
24-
# This is a workaround to allow pushes to a protected branch
25-
token: ${{ secrets.OS_BOTIFY_COMMIT_TOKEN }}
26-
27-
- name: Decrypt & Import OSBotify GPG key
28-
run: |
29-
cd .github
30-
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
31-
gpg --import OSBotify-private-key.asc
32-
env:
33-
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
34-
35-
- name: Set up git for OSBotify
36-
run: |
37-
git config --global user.signingkey AEE1036472A782AB
38-
git config --global commit.gpgsign true
39-
git config --global user.name OSBotify
40-
git config --global user.email infra+osbotify@expensify.com
41-
42-
- uses: actions/setup-node@v4
43-
with:
44-
node-version-file: '.nvmrc'
45-
registry-url: 'https://registry.npmjs.org'
46-
47-
- name: Install yarn packages
48-
run: yarn install --immutable
49-
50-
- name: Update npm version
51-
run: yarn version patch
52-
53-
- name: Set new version in GitHub ENV
54-
run: echo "NEW_VERSION=$(jq '.version' package.json)" >> $GITHUB_ENV
55-
56-
- name: Commit version bump
57-
run: git commit -am "Bump version to ${{ env.NEW_VERSION }}"
58-
59-
- name: Tag version bump
60-
run: git tag ${{ env.NEW_VERSION }}
61-
62-
- name: Push branch and publish tags
63-
run: git push --set-upstream origin main && git push --tags
64-
65-
- name: Build package
66-
run: yarn pack
67-
68-
- name: Publish to npm
69-
run: npm publish --access public
70-
env:
71-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
12+
publish:
13+
# os-botify[bot] will update the version on `main`, so this check is important to prevent an infinite loop
14+
if: ${{ github.actor != 'os-botify[bot]' }}
15+
uses: Expensify/GitHub-Actions/.github/workflows/npmPublish.yml@main
16+
secrets: inherit
17+
with:
18+
should_run_pack: true

.github/workflows/web-e2e-test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ jobs:
2020
test:
2121
if: github.repository == 'Expensify/react-native-live-markdown'
2222
runs-on: ubuntu-latest
23-
defaults:
24-
run:
25-
working-directory: ./WebExample
2623

2724
concurrency:
2825
group: web-e2e-test-${{ github.ref }}
@@ -37,7 +34,7 @@ jobs:
3734
node-version: 18
3835

3936
- name: Install node_modules
40-
run: yarn install --immutable
37+
run: npm ci
4138

4239
- name: Install browsers
4340
run: npx playwright install --with-deps
@@ -46,4 +43,5 @@ jobs:
4643
run: npx playwright install-deps
4744

4845
- name: Run Playwright tests
49-
run: yarn test
46+
run: npm run test
47+
working-directory: WebExample

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,3 @@ lib/
8080
# react-native-live-markdown
8181
android/src/main/assets/react-native-live-markdown-parser.js
8282
.build_complete
83-
84-
# GitHub GPG Keys
85-
.github/OSBotify-private-key.asc

0 commit comments

Comments
 (0)