File tree Expand file tree Collapse file tree 3 files changed +77
-0
lines changed
Expand file tree Collapse file tree 3 files changed +77
-0
lines changed Original file line number Diff line number Diff line change 1+ name : publish
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ env :
8+ NPM_AUTH_TOKEN : ${{ secrets.NPM_AUTH_TOKEN }}
9+ NPM_AUTH_TOKEN_ORG : ${{ secrets.NPM_AUTH_TOKEN_ORG }}
10+
11+ jobs :
12+ publish :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - uses : actions/checkout@v2
17+
18+ - name : Install Dependencies
19+ run : yarn --frozen-lockfile
20+
21+ - name : Build packages
22+ run : yarn build-packages
23+
24+ - name : Run linter
25+ run : yarn lint
26+
27+ - name : Run prettier
28+ run : yarn prettier:check
29+
30+ - name : Run tests
31+ run : yarn test
32+
33+ - name : Publish
34+ run : sh ./bin/publishbeta.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ status=0
4+
5+ (./bin/try-publish-beta.sh " file-input" ) || status=1
6+
7+ exit $status
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ package=$1
4+
5+ status=0
6+
7+ echo -e " \033[0;33mStarting try to publish for \" ${package} \" \033[0m\n"
8+
9+ cd ./packages/$package
10+
11+ name=$( cat package.json | grep name | head -n 1 | cut -d' "' -f 4)
12+ version=$( cat package.json | grep version | head -n 1 | cut -d' "' -f 4)
13+ published=$( npm info $name version 2> /dev/null)
14+
15+ if [ -z " $published " ]; then
16+ published=" 0.0.0"
17+ fi
18+
19+ if [ " $published " != " $version " ]; then
20+ echo " Try to publish $version version of the $name package."
21+ echo " //registry.npmjs.org/:_authToken=\$ {NPM_AUTH_TOKEN}" > .npmrc
22+
23+ npm publish --tag beta --access public; if [ " $? " != " 0" ]; then status=1; fi
24+ else
25+ echo " Current version of the package already published to the NPM."
26+ fi
27+
28+ sleep 2
29+
30+ if [ " $status " != " 0" ]; then
31+ echo -e " \n\033[0;31mThe try to publish for \" ${package} \" exited with $status \033[0m\n"
32+ else
33+ echo -e " \n\033[0;32mThe try to publish for \" ${package} \" exited with 0\033[0m\n"
34+ fi
35+
36+ exit $status
You can’t perform that action at this time.
0 commit comments