Skip to content

Commit

Permalink
chore: update publish sctipt
Browse files Browse the repository at this point in the history
  • Loading branch information
Selnapenek committed Jun 22, 2022
1 parent 32c5cfd commit bf6b820
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v3
with:
node-version: 14

- name: Install Dependencies
run: yarn --frozen-lockfile
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 14

- name: Install Dependencies
run: yarn --frozen-lockfile
Expand All @@ -30,5 +33,10 @@ jobs:
- name: Run tests
run: yarn test

- name: Publish beta
if: github.event.release.prerelease != false
run: sh ./bin/publish.sh beta

- name: Publish
if: github.event.release.prerelease != true
run: sh ./bin/publish.sh
44 changes: 22 additions & 22 deletions bin/publish.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
#!/bin/bash

beta=$1
status=0

(./bin/try-publish.sh "core" "api-client") || status=1
(./bin/try-publish.sh "core" "apollo-client") || status=1
(./bin/try-publish.sh "core" "apollo-links") || status=1
(./bin/try-publish.sh "core" "auth") || status=1
(./bin/try-publish.sh "core" "utils") || status=1
(./bin/try-publish.sh "core" "validate") || status=1
(./bin/try-publish.sh "core" "api-token-auth-client") || status=1
(./bin/try-publish.sh "core" "web-auth0-auth-client") || status=1
(./bin/try-publish.sh "core" "web-native-auth-client") || status=1
(./bin/try-publish.sh "core" "web-cognito-auth-client") || status=1
(./bin/try-publish.sh "core" "web-oauth-client") || status=1
(./bin/try-publish.sh "core" "8base-sdk") || status=1
(./bin/try-publish.sh "core" "api-client" "$beta") || status=1
(./bin/try-publish.sh "core" "apollo-client" "$beta") || status=1
(./bin/try-publish.sh "core" "apollo-links" "$beta") || status=1
(./bin/try-publish.sh "core" "auth" "$beta") || status=1
(./bin/try-publish.sh "core" "utils" "$beta") || status=1
(./bin/try-publish.sh "core" "validate" "$beta") || status=1
(./bin/try-publish.sh "core" "api-token-auth-client" "$beta") || status=1
(./bin/try-publish.sh "core" "web-auth0-auth-client" "$beta") || status=1
(./bin/try-publish.sh "core" "web-native-auth-client" "$beta") || status=1
(./bin/try-publish.sh "core" "web-cognito-auth-client" "$beta") || status=1
(./bin/try-publish.sh "core" "web-oauth-client" "$beta") || status=1
(./bin/try-publish.sh "core" "8base-sdk" "$beta") || status=1

(./bin/try-publish.sh "react" "app-provider") || status=1
(./bin/try-publish.sh "react" "auth") || status=1
(./bin/try-publish.sh "react" "crud") || status=1
(./bin/try-publish.sh "react" "file-input") || status=1
(./bin/try-publish.sh "react" "forms") || status=1
(./bin/try-publish.sh "react" "permissions-provider") || status=1
(./bin/try-publish.sh "react" "table-schema-provider") || status=1
(./bin/try-publish.sh "react" "utils") || status=1
(./bin/try-publish.sh "react" "8base-react-sdk") || status=1
(./bin/try-publish.sh "react" "app-provider" "$beta") || status=1
(./bin/try-publish.sh "react" "auth" "$beta") || status=1
(./bin/try-publish.sh "react" "crud" "$beta") || status=1
(./bin/try-publish.sh "react" "file-input" "$beta") || status=1
(./bin/try-publish.sh "react" "forms" "$beta") || status=1
(./bin/try-publish.sh "react" "permissions-provider" "$beta") || status=1
(./bin/try-publish.sh "react" "table-schema-provider" "$beta") || status=1
(./bin/try-publish.sh "react" "utils" "$beta") || status=1
(./bin/try-publish.sh "react" "8base-react-sdk" "$beta") || status=1

exit $status
9 changes: 8 additions & 1 deletion bin/try-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

scope=$1
package=$2
beta=$3

status=0

Expand Down Expand Up @@ -29,7 +30,13 @@ if [ "$published" != "$version" ]; then
fi
fi

npm publish --access public; if [ "$?" != "0" ]; then status=1; fi
if [ "$beta" != "beta" ]; then
npm publish --access public;
else
npm publish --tag beta --access public;
fi

if [ "$?" != "0" ]; then status=1; fi
else
echo "Current version of the package already published to the NPM."
fi
Expand Down

0 comments on commit bf6b820

Please sign in to comment.