Skip to content

Commit

Permalink
added release archive script
Browse files Browse the repository at this point in the history
  • Loading branch information
iNerdStack committed Mar 3, 2024
1 parent 0b47884 commit e1b6999
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -76,3 +76,8 @@ android/keystores/debug.keystore

# generated by bob
lib/

# generated module assets
*.tar.gz
*.tgz
*.zip
40 changes: 40 additions & 0 deletions exports/pack-github-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# Navigate to the project root directory; assumes the script is run from the exports directory
cd ..

# Fetch package name and version directly from package.json
version=$(npm pkg get version | tr -d '"')
name=$(npm pkg get name | tr -d '"')

# Sanitize package name for use in filename
sanitizedName=$(echo "$name" | sed 's/@//;s/\//-/')

# Define output filename base, saving archives in the exports directory
outputFilename="exports/${sanitizedName}-${version}"

# Create .tar.gz archive
tar --exclude='node_modules' \
--exclude='.git' \
--exclude='exports' \
--exclude='.expo' \
--exclude='.vscode' \
--exclude='temp' \
--exclude='.yarn/cache' \
--exclude='.yarn/install-state.gz' \
--exclude='*.zip' \
--exclude='*.tar.gz' \
-cvzf "${outputFilename}.tar.gz" .

# Create .zip archive
zip -r "${outputFilename}.zip" . \
-x '*node_modules*' \
-x '*.expo*' \
-x '.vscode' \
-x '*.git*' \
-x 'exports/*' \
-x 'temp/*' \
-x '.yarn/cache/*' \
-x '.yarn/install-state.gz' \
-x '*.zip' \
-x '*.tar.gz'

0 comments on commit e1b6999

Please sign in to comment.