GitHub Action
Dart and Flutter Package Publisher
This Action is intended to Continuously Publish Dart packages only IF local pubspec.yml
has different version than already published on Pub.dev site.
It's handy to hook it up on push, pull_request
events.
on: [push, pull_request]
and forget about it. When you need to publish a package, just update the version in pubspec.yaml
.
Required Google Account token from ~/.pub-cache/credentials.json
Put it as secrets.OAUTH_ACCESS_TOKEN
on your repo secrets section
You can find the credentials.json within .pub-cache
in the User's home directory.
You can use open ~/.pub-cache
.
Required Google Account token from ~/.pub-cache/credentials.json
Put it as secrets.OAUTH_REFRESH_TOKEN
on your repo secrets section
You can find the credentials.json within .pub-cache
in the User's home directory.
You can use open ~/.pub-cache
.
Optional Path to your package root in your repository. In case you have a mono-repo, like this one
Optional Perform dry run only, no real publishing. Default: false
Package name from pubspec.
Package local version from pubspec.
Package remote version from pub.dev.
name: Publish to Pub.dev
on: push
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # required!
- name: '>> my package <<'
- uses: k-paxian/dart-package-publisher@master
with:
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}