Skip to content

Instantly share code, notes, and snippets.

@DennisAlund
Created October 11, 2019 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DennisAlund/e82039c42da7a67beaf6a0ab1bfd991f to your computer and use it in GitHub Desktop.
Save DennisAlund/e82039c42da7a67beaf6a0ab1bfd991f to your computer and use it in GitHub Desktop.
Github action workflow for deploying Dart package to pub.dev: https://medium.com/evenbit/publishing-dart-packages-with-github-actions-5240068a2f7d
name: Publish package to pub.dev
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- uses: actions/checkout@v1
- name: Setup credentials
run: |
mkdir -p ~/.pub-cache
cat <<EOF > ~/.pub-cache/credentials.json
{
"accessToken":"${{ secrets.OAUTH_ACCESS_TOKEN }}",
"refreshToken":"${{ secrets.OAUTH_REFRESH_TOKEN }}",
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
"scopes": [ "openid", "https://www.googleapis.com/auth/userinfo.email" ],
"expiration": 1570721159347
}
EOF
- name: Publish package
run: pub publish -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment