-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
# This script creates/updates credentials.json file which is used | ||
# to authorize publisher when publishing packages to pub.dev | ||
|
||
# Checking whether the secrets are available as environment | ||
# variables or not. | ||
if [ -z "${PUB_DEV_PUBLISH_ACCESS_TOKEN}" ]; then | ||
echo "Missing PUB_DEV_PUBLISH_ACCESS_TOKEN environment variable" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${PUB_DEV_PUBLISH_REFRESH_TOKEN}" ]; then | ||
echo "Missing PUB_DEV_PUBLISH_REFRESH_TOKEN environment variable" | ||
exit 1 | ||
fi | ||
|
||
# Create credentials.json file. | ||
mkdir -p ~/.config/dart | ||
cat <<EOF > ~/.config/dart/pub-credentials.json | ||
{ | ||
"accessToken": "${PUB_DEV_PUBLISH_ACCESS_TOKEN}", | ||
"refreshToken": "${PUB_DEV_PUBLISH_REFRESH_TOKEN}", | ||
"tokenEndpoint": "https://accounts.google.com/o/oauth2/token", | ||
"scopes": ["https://www.googleapis.com/auth/userinfo.email","openid"], | ||
"expiration": 1655303397262 | ||
} | ||
EOF |