Skip to content

Commit e1b6999

Browse files
committed
added release archive script
1 parent 0b47884 commit e1b6999

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,8 @@ android/keystores/debug.keystore
7676

7777
# generated by bob
7878
lib/
79+
80+
# generated module assets
81+
*.tar.gz
82+
*.tgz
83+
*.zip

exports/pack-github-release.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# Navigate to the project root directory; assumes the script is run from the exports directory
4+
cd ..
5+
6+
# Fetch package name and version directly from package.json
7+
version=$(npm pkg get version | tr -d '"')
8+
name=$(npm pkg get name | tr -d '"')
9+
10+
# Sanitize package name for use in filename
11+
sanitizedName=$(echo "$name" | sed 's/@//;s/\//-/')
12+
13+
# Define output filename base, saving archives in the exports directory
14+
outputFilename="exports/${sanitizedName}-${version}"
15+
16+
# Create .tar.gz archive
17+
tar --exclude='node_modules' \
18+
--exclude='.git' \
19+
--exclude='exports' \
20+
--exclude='.expo' \
21+
--exclude='.vscode' \
22+
--exclude='temp' \
23+
--exclude='.yarn/cache' \
24+
--exclude='.yarn/install-state.gz' \
25+
--exclude='*.zip' \
26+
--exclude='*.tar.gz' \
27+
-cvzf "${outputFilename}.tar.gz" .
28+
29+
# Create .zip archive
30+
zip -r "${outputFilename}.zip" . \
31+
-x '*node_modules*' \
32+
-x '*.expo*' \
33+
-x '.vscode' \
34+
-x '*.git*' \
35+
-x 'exports/*' \
36+
-x 'temp/*' \
37+
-x '.yarn/cache/*' \
38+
-x '.yarn/install-state.gz' \
39+
-x '*.zip' \
40+
-x '*.tar.gz'

0 commit comments

Comments
 (0)