Skip to content

Commit cd3dc93

Browse files
committed
Merge branch 'main' into @tomekzaw/macos
2 parents 7026df1 + ea2b1af commit cd3dc93

File tree

172 files changed

+34214
-28094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+34214
-28094
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
**/node_modules/*
2-
parser/react-native-live-markdown-parser.js
32

43
# any js file inside android and ios folders
54
**/android/**/*.js
-3.85 KB
Binary file not shown.

.github/workflows/build-android.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@ jobs:
2626
build:
2727
if: github.repository == 'Expensify/react-native-live-markdown'
2828
runs-on: ubuntu-latest
29-
strategy:
30-
matrix:
31-
react-native-architecture: ['Paper', 'Fabric']
32-
fail-fast: false
3329
concurrency:
34-
group: build-android-${{ matrix.react-native-architecture }}-${{ github.ref }}
30+
group: build-android-${{ github.ref }}
3531
cancel-in-progress: true
3632
steps:
3733
- name: Check out Git repository
38-
uses: actions/checkout@v4
34+
# v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3936

4037
- name: Setup Java 17
41-
uses: actions/setup-java@v4
38+
# v4
39+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
4240
with:
4341
distribution: 'zulu'
4442
java-version: 17
4543

4644
- name: Install node_modules
47-
run: yarn install --immutable
45+
run: npm ci
4846

4947
- name: Build app
5048
working-directory: example/android
51-
run: ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a -PnewArchEnabled=${{ matrix.react-native-architecture == 'Fabric' && 'true' || 'false' }}
49+
run: ./gradlew assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a

.github/workflows/build-ios.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,43 +26,40 @@ jobs:
2626
build:
2727
if: github.repository == 'Expensify/react-native-live-markdown'
2828
runs-on: macos-13
29-
strategy:
30-
matrix:
31-
react-native-architecture: ['Paper', 'Fabric']
32-
fail-fast: false
3329
concurrency:
34-
group: build-ios-${{ matrix.react-native-architecture }}-${{ github.ref }}
30+
group: build-ios-${{ github.ref }}
3531
cancel-in-progress: true
3632
steps:
3733
- name: Check out Git repository
38-
uses: actions/checkout@v4
34+
# v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
3936

4037
- name: Restore node_modules from cache
41-
uses: actions/cache@v4
38+
# v4
39+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
4240
with:
4341
path: |
4442
node_modules
4543
example/node_modules
46-
key: build-ios-node-modules-${{ matrix.react-native-architecture }}-${{ hashFiles('yarn.lock') }}
47-
restore-keys: build-ios-node-modules-${{ matrix.react-native-architecture }}-
44+
key: build-ios-node-modules-${{ hashFiles('package-lock.json') }}
45+
restore-keys: build-ios-node-modules-
4846

4947
- name: Install node_modules
50-
run: yarn install --immutable
48+
run: npm ci
5149

5250
- name: Restore Pods from cache
53-
uses: actions/cache@v4
51+
# v4
52+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
5453
with:
5554
path: |
5655
example/ios/Pods
5756
~/Library/Caches/CocoaPods
5857
~/.cocoapods
59-
key: build-ios-pods-${{ matrix.react-native-architecture }}-${{ hashFiles('example/node_modules/react-native/package.json') }}
60-
restore-keys: build-ios-pods-${{ matrix.react-native-architecture }}-
58+
key: build-ios-pods-${{ hashFiles('node_modules/react-native/package.json') }}
59+
restore-keys: build-ios-pods-
6160

6261
- name: Install Pods
6362
working-directory: example/ios
64-
env:
65-
RCT_NEW_ARCH_ENABLED: ${{ matrix.react-native-architecture == 'Fabric' && '1' || '0' }}
6663
run: |
6764
bundler install
6865
bundler exec pod install
@@ -72,12 +69,13 @@ jobs:
7269
run: rm -rf .xcode.env.local
7370

7471
- name: Restore build artifacts from cache
75-
uses: actions/cache@v4
72+
# v4
73+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
7674
with:
7775
path: ~/Library/Developer/Xcode/DerivedData
78-
key: build-ios-derived-data-${{ matrix.react-native-architecture }}-${{ hashFiles('example/node_modules/react-native/package.json') }}
79-
restore-keys: build-ios-derived-data-${{ matrix.react-native-architecture }}-
76+
key: build-ios-derived-data-${{ hashFiles('node_modules/react-native/package.json') }}
77+
restore-keys: build-ios-derived-data-
8078

8179
- name: Build app
8280
working-directory: example
83-
run: npx react-native@latest run-ios --no-packager
81+
run: npx react-native run-ios --no-packager

.github/workflows/build-web.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ jobs:
2525
cancel-in-progress: true
2626
steps:
2727
- name: Check out Git repository
28-
uses: actions/checkout@v4
28+
# v4
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2930

3031
- name: Install node_modules
31-
run: yarn install --immutable
32+
run: npm ci
3233

3334
- name: Build app
3435
working-directory: WebExample

.github/workflows/check.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,29 @@ jobs:
1717
cancel-in-progress: true
1818
steps:
1919
- name: Check out Git repository
20-
uses: actions/checkout@v4
20+
# v4
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2122

2223
- name: Use Node.js 18
23-
uses: actions/setup-node@v4
24+
# v4
25+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
2426
with:
2527
node-version: 18
2628

2729
- name: Install node_modules
28-
run: yarn install --immutable
29-
30-
- name: Verify there's no parser diff
31-
working-directory: parser
32-
run: |
33-
yarn build
34-
if ! git diff --name-only --exit-code; then
35-
# shellcheck disable=SC2016
36-
echo 'Error: Parser diff detected! Please run `cd parser && yarn build` and commit the changes.'
37-
exit 1
38-
fi
30+
run: npm ci
3931

4032
- name: Typecheck library
41-
run: yarn tsc --project tsconfig.json --noEmit
42-
43-
- name: Typecheck parser
44-
run: yarn tsc --project parser/tsconfig.json --noEmit
33+
run: npm run typecheck -- --project tsconfig.json
4534

4635
- name: Typecheck example app
47-
run: yarn tsc --project example/tsconfig.json --noEmit
36+
run: npm run typecheck -- --project example/tsconfig.json
4837

4938
- name: Typecheck WebExample app
50-
run: yarn tsc --project WebExample/tsconfig.json --noEmit
39+
run: npm run typecheck -- --project WebExample/tsconfig.json
5140

5241
- name: Lint
53-
run: yarn lint
42+
run: npm run lint
5443

5544
- name: Test
56-
run: yarn test
45+
run: npm run test

.github/workflows/cla.yml

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,12 @@
11
name: CLA Assistant
22

33
on:
4-
issue_comment:
5-
types: [created]
6-
pull_request_target:
7-
types: [opened, closed, synchronize]
4+
issue_comment:
5+
types: [created]
6+
pull_request_target:
7+
types: [opened, synchronize]
88

99
jobs:
10-
CLA:
11-
runs-on: ubuntu-latest
12-
# This job only runs for pull request comments or pull request target events (not issue comments)
13-
if: github.event.issue.pull_request || github.event_name == 'pull_request_target'
14-
steps:
15-
- uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
16-
id: sign
17-
with:
18-
text: ${{ github.event.comment.body }}
19-
regex: '\s*I have read the CLA Document and I hereby sign the CLA\s*'
20-
- uses: actions-ecosystem/action-regex-match@9c35fe9ac1840239939c59e5db8839422eed8a73
21-
id: recheck
22-
with:
23-
text: ${{ github.event.comment.body }}
24-
regex: '\s*recheck\s*'
25-
- name: CLA Assistant
26-
if: ${{ steps.recheck.outputs.match != '' || steps.sign.outputs.match != '' }} || github.event_name == 'pull_request_target'
27-
# Version: 2.1.2-beta
28-
uses: cla-assistant/github-action@948230deb0d44dd38957592f08c6bd934d96d0cf
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_BOTIFY_TOKEN }}
32-
with:
33-
path-to-signatures: '${{ github.repository }}/cla.json'
34-
path-to-document: 'https://github.com/${{ github.repository }}/blob/main/CLA.md'
35-
branch: 'main'
36-
remote-organization-name: 'Expensify'
37-
remote-repository-name: 'CLA'
38-
lock-pullrequest-aftermerge: false
39-
allowlist: 'snyk-bot,OSBotify'
10+
CLA:
11+
uses: Expensify/GitHub-Actions/.github/workflows/cla.yml@main
12+
secrets: inherit

.github/workflows/lint.yml

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
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@v4
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@v4
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+
# v4
22+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e
23+
with:
24+
node-version: '20.x'
2425

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

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
29+
- name: Verify there's no Prettier diff
30+
run: |
31+
npm run lint -- --fix --quiet
32+
if ! git diff --name-only --exit-code; then
33+
# shellcheck disable=SC2016
34+
echo 'Error: Prettier diff detected! Please run `npm run lint -- --fix` and commit the changes.'
35+
exit 1
36+
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 [email protected]
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

0 commit comments

Comments
 (0)