All Projects → k-paxian → dart-package-publisher

k-paxian / dart-package-publisher

Licence: MIT license
Action to Publish Dart / Flutter Package To https://pub.dev When you need to publish a package, just bump the version in pubspec.yaml

Programming Languages

shell
77523 projects
dart
5743 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to dart-package-publisher

clojure-dependency-update-action
A simple GitHub Actions job to create Pull Requests for outdated dependencies in clojure projects
Stars: ✭ 37 (-17.78%)
Mutual labels:  actions, action, github-actions
jest-github-action
Jest action adding checks with annotations to your pull requests and coverage table as comments
Stars: ✭ 134 (+197.78%)
Mutual labels:  actions, action, github-actions
rubocop-linter-action
Rubocop Linter Action: A GitHub Action to run Rubocop against your code!
Stars: ✭ 86 (+91.11%)
Mutual labels:  actions, action, github-actions
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-73.33%)
Mutual labels:  actions, action, github-actions
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-44.44%)
Mutual labels:  actions, action, github-actions
mc-publish
GitHub Action that helps you publish your Minecraft mods
Stars: ✭ 76 (+68.89%)
Mutual labels:  actions, publish, github-actions
actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (+48.89%)
Mutual labels:  actions, action, github-actions
setup-jdk
(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
Stars: ✭ 32 (-28.89%)
Mutual labels:  actions, action, github-actions
action-autotag
Automatically generate a new tag when the manifest file (package.json, Dockerfile, custom file, etc) version changes.
Stars: ✭ 45 (+0%)
Mutual labels:  actions, action, github-actions
ssh2actions
Connect to GitHub Actions VM via SSH for interactive debugging
Stars: ✭ 62 (+37.78%)
Mutual labels:  actions, action, github-actions
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+211.11%)
Mutual labels:  actions, action, github-actions
upx-action
Strips and runs upx on binaries
Stars: ✭ 17 (-62.22%)
Mutual labels:  actions, action, github-actions
github-run-tests-action
mabl Github Actions implementation
Stars: ✭ 39 (-13.33%)
Mutual labels:  actions, action, github-actions
action-homebrew-bump-formula
⚙️ A GitHub Action to easily bump Homebrew formula on new release
Stars: ✭ 68 (+51.11%)
Mutual labels:  actions, action, github-actions
python-actions-alpha-archived
Please note that this was for the *alpha* version of GitHub Actions for Python.
Stars: ✭ 15 (-66.67%)
Mutual labels:  actions, github-actions
netlify-build-github-actions
An example of triggering a Netlify build using Github Actions Scheduled Events
Stars: ✭ 31 (-31.11%)
Mutual labels:  actions, github-actions
chrome-addon
☁ GitHub action to upload addon to Chrome
Stars: ✭ 53 (+17.78%)
Mutual labels:  actions, github-actions
actions-deploy-gist
📌 Deploy file to Github Gist
Stars: ✭ 26 (-42.22%)
Mutual labels:  actions, github-actions
redux-reducer-async
Create redux reducers for async behaviors of multiple actions.
Stars: ✭ 14 (-68.89%)
Mutual labels:  actions, action
action-eslint
🐋🐬 TypeScript/JavaScript ESLint action
Stars: ✭ 24 (-46.67%)
Mutual labels:  action, github-actions

Build Status

Description

Continuously Test & Publish Dart and Flutter Package To Pub.dev When Version Changed

Prerequisite

You have to be a Verified Publisher to be able to publish from GH action w/o Pub needs your authorization to upload packages on your behalf check in console.

The Challenge

Usually, when you are trying to pub lish your Dart package (or pub publish your Flutter package) and your pubspec.yaml has the same version as already published, you'll have a non zero exit code from pub tool and your workflow is red 🔴. So you cannot directly hook publish command as an re-action to on: push event.

To keep a workflow green 🟢 on each push, you have to prevent publishing step if versions are the same, and to compare versions, you should have both of them, remote and local.

This Action is intended to solve this challenge by continuously Test & Publish Dart/Flutter 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 events.

on: push

and forget about it. When you need to publish a package, just bump the version in pubspec.yaml.

dart-package-publisher

Inputs 📥

accessToken

Required Google Account token from ~/.config/dart/pub-credentials.json Put it as secrets.OAUTH_ACCESS_TOKEN on your repo secrets section

You can find the pub-credentials.json within .config/dart in the User's home directory. You can use open ~/.config/dart.

refreshToken

Required Google Account token from ~/.config/dart/pub-credentials.json Put it as secrets.OAUTH_REFRESH_TOKEN on your repo secrets section

You can find the pub-credentials.json within .config/dart in the User's home directory. You can use open ~/.config/dart.

credentialJson

Replaces accessToken and refreshToken and contains the whole content of the ~/.config/dart/pub-credentials.json file Put it as secrets.CREDENTIAL_JSON on your repo secrets section

You can find the pub-credentials.json within .config/dart in the User's home directory. You can use open ~/.config/dart after your first publication either through dart pub lish command for Dart or flutter pub publish for Flutter.

relativePath

Optional Path to your package root in your repository. In case you have a mono-repo, like this one

dryRunOnly

Optional Perform dry run only, no real publishing. Default: false

testRunOnly

Optional Perform unit tests run only, no real publishing. Default: false

skipTests

Optional Skip unit tests run. Default: false

suppressBuildRunner

Optional Suppress using build_runner for unit tests run. Default: false

format

Optional Format code of project to get better score in pub.dev. Default: false

force

Optional Force publishing even if pub tool throws warnings, hints, etc. Default: false

flutter

Optional Flutter package type. Default: false, when omitted auto detected

flutterBranch

Optional Flutter branch to use, stable, master, main, dev, etc. Default: stable

Outputs 📤

success

Result, "true" if actual publishing happened, "false" otherwise

package

Package name from pubspec

localVersion

Package local version from pubspec

remoteVersion

Package remote version from pub.dev

dartVersion

Dart SDK version which is being used to run tests & publish

flutterVersion

Flutter SDK version which is being used to run tests & publish

Dart or Flutter package example usage

name: Publish to Pub.dev

on: push

jobs:
  publishing:
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout'
        uses: actions/checkout@main # required!
        
      - name: '>> Dart package <<'
        uses: k-paxian/dart-package-publisher@master
        with:
          accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
          refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].