Skip to content

Commit

Permalink
fix: manually copy API files in build/api folder
Browse files Browse the repository at this point in the history
Signed-off-by: D4ryl00 <d4ryl00@gmail.com>
  • Loading branch information
D4ryl00 committed Oct 23, 2024
1 parent 7ecb4b3 commit bb6fb30
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:

- name: Install NPM dependencies
working-directory: ./
run: yarn
run: |
yarn
yarn postbuild
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ __tests__
# Excluding yarn.lock causes the local build to fail.
# This is because the build is done on the host machine.
!yarn.lock

# Go compilation needs .tool-versions
!.tool-versions
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fclean: clean

node_modules: package.json yarn.lock
(yarn && touch $@) || true
yarn postbuild

# - API : Handle API generation and cleaning

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "module",
"scripts": {
"build": "expo-module build",
"postbuild": "sh postbuild.sh",
"clean": "expo-module clean",
"lint": "expo-module lint",
"test": "expo-module test",
Expand Down
14 changes: 14 additions & 0 deletions postbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

#If the folder exists, copy API files
if [ -d "./build" ]; then

cp ./src/api/protocoltypes.pb.js ./build/api/
cp ./src/api/protocoltypes.pb.d.ts ./build/api/
cp ./src/api/rpcmanager.pb.d.ts ./build/api/
cp ./src/api/rpcmanager.pb.js ./build/api/

#Else prints an error
else
echo "Error: build folder not found, please do \`yarn install\` first"
fi

0 comments on commit bb6fb30

Please sign in to comment.