Skip to content

[STR-335] Automate SDK publishing#24

Merged
frostbournesb merged 6 commits intodevelopfrom
task/dante/str-335
Feb 13, 2023
Merged

[STR-335] Automate SDK publishing#24
frostbournesb merged 6 commits intodevelopfrom
task/dante/str-335

Conversation

@frostbournesb
Copy link
Copy Markdown
Contributor

@frostbournesb frostbournesb commented Feb 9, 2023

Late last night, I worked on making an automated script to make sure that we never mess up

cd scripts -- You must run it from the scripts folder, for now

Run python3 publish.py to view the help screen

usage: publish.py [-h] [-p] [-d] [-a] [-u] [-s]

String SDK Publisher

optional arguments:
-h, --help show this help message and exit
-p, --prod Publish to prod
-d, --dev Publish to dev
-a, --all Publish to both dev and prod
-u, --use-env Use sensitive vars from .env
-s, --same-ver Don't automatically increment version

Don't worry about running it, it will run a dry run first then ask you if you want to publish

It will cache your .env so don't worry about changing that back
It will save a backup of your package.json before it changes anything, so you can see if it messed up

Use -u to use your fingerprint PK from .env
If you don't use it, you will need to put it in env-dev.txt or env-prod.txt (don't gitignore them, it will automatically remove it after running)

It will handle automatically incrementing the version, use -s if you want to manually change the version and use that.

@frostbournesb frostbournesb requested a review from auroter February 9, 2023 19:26
@ocasta181
Copy link
Copy Markdown
Collaborator

ocasta@Ocastas-MacBook-Pro scripts % python3 publish.py -du
--------Publishing to @stringpay/sdk-dev
Skipping .env cache
Setting .env to env-dev
Incrementing package.json version from 0.1.7 to 0.1.8
yarn run v1.22.19
$ rm -rf ./dist; rollup -c

./src/lib/StringPay.ts → ./dist/stringpay-v0.1.8.min.js...
created ./dist/stringpay-v0.1.8.min.js in 1s
✨  Done in 1.52s.
Applying and removing .env cache
npm notice 
npm notice 📦  @stringpay/sdk-dev@0.1.8
npm notice === Tarball Contents === 
npm notice 1.4kB  README.md                   
npm notice 556B   dist/index.d.ts             
npm notice 14.4kB dist/stringpay-v0.1.8.min.js
npm notice 2.0kB  package.json                
npm notice === Tarball Details === 
npm notice name:          @stringpay/sdk-dev                      
npm notice version:       0.1.8                                   
npm notice filename:      @stringpay/sdk-dev-0.1.8.tgz            
npm notice package size:  7.1 kB                                  
npm notice unpacked size: 18.3 kB                                 
npm notice shasum:        7b03dfc18e5b8250e3eb8ef75e17e7f1759f3572
npm notice integrity:     sha512-8OChcoTqSjifD[...]5hSZLCdRvSzCQ==
npm notice total files:   4                                       
npm notice 
npm notice Publishing to https://registry.npmjs.org/ (dry-run)
+ @stringpay/sdk-dev@0.1.8
Would you like to publish for real? (y/n): n
Ok, not publishing
Removing sensitive data from env-prod.txt
Removing sensitive data from env-dev.txt
Thanks for using the Automated String SDK Publisher

@ocasta181
Copy link
Copy Markdown
Collaborator

ocasta@Ocastas-MacBook-Pro scripts % python3 publish.py -pu
--------Publishing to @stringpay/sdk
Caching user .env
Setting .env to env-prod
Incrementing package.json version from 0.1.8 to 0.1.9
yarn run v1.22.19
$ rm -rf ./dist; rollup -c

./src/lib/StringPay.ts → ./dist/stringpay-v0.1.9.min.js...
created ./dist/stringpay-v0.1.9.min.js in 1s
✨  Done in 1.58s.
Applying and removing .env cache
npm notice 
npm notice 📦  @stringpay/sdk@0.1.9
npm notice === Tarball Contents === 
npm notice 1.4kB  README.md                   
npm notice 556B   dist/index.d.ts             
npm notice 14.4kB dist/stringpay-v0.1.9.min.js
npm notice 2.0kB  package.json                
npm notice === Tarball Details === 
npm notice name:          @stringpay/sdk                          
npm notice version:       0.1.9                                   
npm notice filename:      @stringpay/sdk-0.1.9.tgz                
npm notice package size:  7.1 kB                                  
npm notice unpacked size: 18.3 kB                                 
npm notice shasum:        b41278a0ef9e32d20b5aaec3e3625d7916af624f
npm notice integrity:     sha512-aORC5XPHBpEPw[...]4LSx6v9BasyfA==
npm notice total files:   4                                       
npm notice 
npm notice Publishing to https://registry.npmjs.org/ (dry-run)
+ @stringpay/sdk@0.1.9
Would you like to publish for real? (y/n): n
Ok, not publishing
Removing sensitive data from env-prod.txt
Removing sensitive data from env-dev.txt
Thanks for using the Automated String SDK Publisher

ocasta181
ocasta181 previously approved these changes Feb 9, 2023
@frostbournesb frostbournesb merged commit 2aa6e73 into develop Feb 13, 2023
@frostbournesb frostbournesb deleted the task/dante/str-335 branch February 13, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants