-
Notifications
You must be signed in to change notification settings - Fork 42
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
03c4d63
commit 79a210d
Showing
1 changed file
with
12 additions
and
20 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 |
---|---|---|
@@ -1,32 +1,24 @@ | ||
name: Publish Package | ||
name: Publish to pub.dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- "release/**" | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+*' # tag pattern on pub.dev: 'v' | ||
|
||
# Publish using custom workflow | ||
jobs: | ||
build: | ||
publish: | ||
permissions: | ||
id-token: write # This is required for authentication using OIDC | ||
runs-on: ubuntu-latest | ||
container: | ||
image: dart:latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- name: Install dependencies | ||
run: dart pub get | ||
- name: Run tests | ||
run: dart pub run test | ||
- name: Setup credentials | ||
run: | | ||
mkdir -p ~/.pub-cache | ||
cat <<EOF > ~/.pub-cache/credentials.json | ||
{ | ||
"accessToken":"${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}", | ||
"refreshToken":"${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}", | ||
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token", | ||
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ], | ||
"expiration": ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }} | ||
} | ||
EOF | ||
- name: Publish package | ||
run: dart pub publish -f | ||
# Here you can insert custom steps you need | ||
# - run: dart tool/generate-code.dart | ||
- name: Publish | ||
run: dart pub publish --force |