how to publish a dart package using Github Actions?
how to publish a dart package using Github Actions?
dart package
flutter package
Github Actions
publish bug
# get credentials.json
$ flutter pub uploader add xgqfrms@gmail.com
$ killall -9 dart
domain bug ❌
Waiting for your authorization...
Authorization received, processing...
It looks like accounts.google.com is having some trouble.
Pub will wait for a while before trying to connect again.
https://github.com/xgqfrms/dart-library-package/issues/4
https://github.com/xgqfrms/dart-library-package/wiki
.github/workflows/dart.yml
name: Dart CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: pub get
- name: Run tests
run: pub run test
$VAR
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '1.9.1+hotfix.6'
- name: Install dependencies
run: flutter pub get
- name: Analyze
run: flutter analyze
- name: Run tests
run: flutter test
- name: Setup Pub Credentials
shell: bash
env:
PUB_DEV_PUBLISH_ACCESS_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
PUB_DEV_PUBLISH_REFRESH_TOKEN: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
PUB_DEV_PUBLISH_TOKEN_ENDPOINT: ${{ secrets.PUB_DEV_PUBLISH_TOKEN_ENDPOINT }}
PUB_DEV_PUBLISH_EXPIRATION: ${{ secrets.PUB_DEV_PUBLISH_EXPIRATION }}
run: |
sh ./pub_login.sh
- name: Check Publish Warnings
run: pub publish --dry-run
- name: Publish Package
run: pub publish -f
refs
publish dart package / publish flutter package
https://birjuvachhani.dev/posts/publish-your-flutter-package-using-github-actions/
https://medium.com/evenbit/publishing-dart-packages-with-github-actions-5240068a2f7d
https://github.com/marketplace/actions/publish-dart-flutter-package
https://github.com/marketplace/actions/dart-and-flutter-package-publisher
GitHub Actions
https://www.cnblogs.com/xgqfrms/p/13624584.html
GitHub Actions & documents tutorials
configuring-and-managing-workflows
reference
https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy
https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
https://docs.github.com/en/actions/reference/events-that-trigger-workflows
https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13627761.html
未经授权禁止转载,违者必究!