-
Notifications
You must be signed in to change notification settings - Fork 465
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
1 parent
a3f875a
commit 85a5448
Showing
2 changed files
with
60 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Dart CI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: google/dart:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Flutter | ||
uses: subosito/flutter-action@v1 | ||
with: | ||
channel: 'stable' | ||
- name: Install dependencies | ||
run: flutter packages get | ||
- name: Code Formatting | ||
run: dartfmt -w . | ||
- name: Check Publish Warnings | ||
run: pub publish --dry-run | ||
- name: Publish Package | ||
run: pub publish -f |
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,35 @@ | ||
# 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 | ||
|
||
if [ -z "${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}" ]; then | ||
echo "Missing PUB_DEV_PUBLISH_TOKEN_ENDPOINT environment variable" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "${PUB_DEV_PUBLISH_EXPIRATION}" ]; then | ||
echo "Missing PUB_DEV_PUBLISH_EXPIRATION environment variable" | ||
exit 1 | ||
fi | ||
|
||
# Create credentials.json file. | ||
cat <<EOF >~/.pub-cache/credentials.json | ||
{ | ||
"accessToken":"${PUB_DEV_PUBLISH_ACCESS_TOKEN}", | ||
"refreshToken":"${PUB_DEV_PUBLISH_REFRESH_TOKEN}", | ||
"tokenEndpoint":"${PUB_DEV_PUBLISH_TOKEN_ENDPOINT}", | ||
"scopes":["https://www.googleapis.com/auth/userinfo.email","openid"], | ||
"expiration":${PUB_DEV_PUBLISH_EXPIRATION} | ||
} | ||
EOF |