Giter Club home page Giter Club logo

dart-package-publisher's People

Contributors

alfredo-handcash avatar k-paxian avatar lcuis avatar tomykho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dart-package-publisher's Issues

Fail to publish `flutter` package when `environment` section requires `flutter` as a dependency

When pubspec.yaml has flutter in the environment section AND flutter: true input was not given in the workflow definition

...
environment:
  sdk: '>=2.6.1 <3.0.0'
  flutter: '>=1.17.0'
...

publishing is failing πŸ”΄ with the console output

Check inputs...
Missing credentialJson, trying tokens
OK
Switching to package directory 'flutter.package'
Package dir: /github/workspace/flutter.package
Because test_flutter_package requires the Flutter SDK, version solving failed.
Flutter users should run `flutter pub get` instead of `dart pub get`.
Because test_flutter_package requires the Flutter SDK, version solving failed.
Flutter users should run `flutter pub get` instead of `dart pub get`.

The reason is described here

Support for hosted packages

Hello @k-paxian, could you add support for hosted packages which take a token for authentication. This could be an additional parameter. Currently it fails with the following errors:

https://dart.pkg.jetbrains.space/vyuh/p/main/vyuh/ package repository requested authentication!
You can provide credentials using:
    flutter pub token add https://dart.pkg.jetbrains.space/vyuh/p/main/vyuh/
Authentication failed!

For the check for remote version, it does not consider the fact that the package is hosted and does a global activation using pub.dev, as seen below:

Because pub global activate depends on vyuh_analytics_provider_firebase any which doesn't exist (could not find package vyuh_analytics_provider_firebase at https://pub.dev),/ version solving failed.
Notice: Local version: [1.0.0]
Notice: Remote version: [βœ—]

support different flutter channel

I have some packages which depends dev channel of flutter, I find the flutter channel of this github action was hardcoded, is there any options for config the flutter channel.

`Pub needs your authorization to upload packages on your behalf.` for non-verified publisher

While publishing the package to the pub.dev, the dry-runs successfully. But when trying to publishing the package, it returns a link that says to 'In the web browser paste the link and click on Allow access', When pasted the link in a web browser, it returns unable to connect.

Tried by

  1. Adding content in credentials.json in .pub-cached to secrets.CREDENTIAL_JSON variable.
  2. Adding accessToken and refreshToken

Attaching the screenshot below.
image1
image2

Appreciate any help that unblocks me. Thank you.

Getting missing access token even though it is present in the github secrets

Hi,
I am trying to automate the publishing of a flutter package for which i added the access token and refresh token in the secrets. But i am still getting the error stating missing access token ?

  • name: 'my_package'
    uses: k-paxian/dart-package-publisher@master
    with:
    skipTests: true
    dryRunOnly: true
    accessToken: ${{ secrets.ABC_OAUTH_ACCESS_TOKEN }}
    refreshToken: ${{ secrets.ABC_OAUTH_REFRESH_TOKEN }}

Could not find a file named "pubspec.yaml" in "/opt/hostedtoolcache/flutter/2.10.2-stable/x64/.pub-cache/hosted/pub.dartlang.org/async-2.8.2".

https://github.com/qssq/smart_grid_pageview/runs/5432832386?check_suite_focus=true

/usr/bin/docker run --name a95e9a5[13](https://github.com/qssq/smart_grid_pageview/runs/5432832386?check_suite_focus=true#step:7:13)2a0aa7b4a0cb9acf939[15](https://github.com/qssq/smart_grid_pageview/runs/5432832386?check_suite_focus=true#step:7:15)9[17](https://github.com/qssq/smart_grid_pageview/runs/5432832386?check_suite_focus=true#step:7:17)032_2a1[24](https://github.com/qssq/smart_grid_pageview/runs/5432832386?check_suite_focus=true#step:7:24)4 --label 29a95e --workdir /github/workspace --rm -e FLUTTER_ROOT -e PUB_CACHE -e INPUT_ACCESSTOKEN -e INPUT_REFRESHTOKEN -e INPUT_CREDENTIALJSON -e INPUT_RELATIVEPATH -e INPUT_DRYRUNONLY -e INPUT_SKIPTESTS -e INPUT_SUPPRESSBUILDRUNNER -e INPUT_FORMAT -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/smart_grid_pageview/smart_grid_pageview":"/github/workspace" 29a95e:9a5132a0aa7b4a0cb9acf93915917032
Check inputs...
Missing credentialJson, trying tokens
OK
Package dir: /github/workspace
Because smart_gridded_pageview requires the Flutter SDK, version solving failed.

Flutter users should run `flutter pub get` instead of `dart pub get`.
Because smart_gridded_pageview requires the Flutter SDK, version solving failed.

Flutter users should run `flutter pub get` instead of `dart pub get`.
Could not find a file named "pubspec.yaml" in "/opt/hostedtoolcache/flutter/2.10.2-stable/x64/.pub-cache/hosted/pub.dartlang.org/async-2.8.2".

No package found. :(


Add config to skip build_runner tests

Thanks for this package! It is going to save lot of time for me πŸ‘. I have a request to add a config variable to skip the build_runner tests and instead only do pub run test. The specific piece of code that needs change is below:

run_unit_tests() {
    if [ "$INPUT_SKIPTESTS" = "true" ]; then
      echo "Skip unit tests set to true, skip unit testing."
    else
      if [ "$HAS_BUILD_RUNNER" != "" ] && [ "$HAS_BUILD_TEST" != "" ]; then
        echo "build_runner: $HAS_BUILD_RUNNER"
        echo "build_test: $HAS_BUILD_TEST"
        pub run build_runner test
      else
        if [ "$HAS_TEST" != "" ]; then
          pub run test
        else
          echo "No unit test related dependencies detected, skip unit testing."
        fi      
      fi      
    fi
}

...specifically if [ "$HAS_BUILD_RUNNER" != "" ] && [ "$HAS_BUILD_TEST" != "" ];. You are checking if the build_runner and build_test packages are present and deciding to run the pub run build_runner test.

Can we have an option where we only do build_runner test if explicitly specified. Say with a config input like checkBuildRunner ? Only if this input is set should you execute the build_runner test, else do the pub run test?

Let me know if this sounds reasonable.

Job doesn't fail when dryRunOnly is true

When dryRunOnly: true and the publishing fails, the job doesn't fail. I would expect it to fail.

My usecase is to dry run the publish job for the pull request and if everything is fine merge it on main and have it actually published.

Pub needs your authorization to upload packages on your behalf-for verified publisher

Hi, we are a verified publisher https://pub.dev/packages/m3o yet we are facing problem publishing our package automatically using this GitHub action.

Any idea what we can do to fix this issue, currently we are publishing our package manually.
below is the latest logs, you can see it is setting there waiting for an action from our side.

https://github.com/m3o/m3o-dart/runs/6195174158?check_suite_focus=true#step:9:194

and this is the workflow publish.yml

https://github.com/m3o/m3o-dart/blob/main/.github/workflows/publish.yml

Flutter plugin support error

This is my workflow file:

name: Publish to Pub.dev

on:
  push:
    branches: [ Yeikel200-patch-1 ]

jobs:
  publishing:
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout'
        uses: actions/checkout@v2 # required!
        
      - name: 'ir_sensor_plugin'
        uses: k-paxian/dart-package-publisher@master
        with:
          accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
          refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
          credentialJson: ${{ secrets.CREDENTIAL_JSON }}
          dryRunOnly: true

This is the LOG:

2020-06-12T17:55:26.6931792Z commit 37389951ae792fc3777dd9e0c70ed16f4cebac35
2020-06-12T17:55:26.6932520Z Author: Yeikel Uriarte Arteaga <[email protected]>
2020-06-12T17:55:26.6933122Z Date:   Fri Jun 12 13:52:17 2020 -0500
2020-06-12T17:55:26.6933218Z 
2020-06-12T17:55:26.6933423Z     Add credentialJson
2020-06-12T17:55:26.7058277Z ##[group]Run k-paxian/dart-package-publisher@master
2020-06-12T17:55:26.7058481Z with:
2020-06-12T17:55:26.7059199Z   accessToken: ***
2020-06-12T17:55:26.7060498Z   refreshToken: ***
2020-06-12T17:55:26.7061709Z   credentialJson: ***
2020-06-12T17:55:26.7061906Z   dryRunOnly: true
2020-06-12T17:55:26.7062083Z   skipTests: false
2020-06-12T17:55:26.7062719Z   suppressBuildRunner: false
2020-06-12T17:55:26.7063280Z ##[endgroup]
2020-06-12T17:55:26.7091554Z ##[command]/usr/bin/docker run --name d3b1bc312edeed4d45b6d7826ee60b428c_5bff95 --label 3888d3 --workdir /github/workspace --rm -e INPUT_ACCESSTOKEN -e INPUT_REFRESHTOKEN -e INPUT_CREDENTIALJSON -e INPUT_DRYRUNONLY -e INPUT_RELATIVEPATH -e INPUT_SKIPTESTS -e INPUT_SUPPRESSBUILDRUNNER -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/ir_sensor_plugin/ir_sensor_plugin":"/github/workspace" 3888d3:b1bc312edeed4d45b6d7826ee60b428c
2020-06-12T17:55:27.2758248Z Check inputs...
2020-06-12T17:55:27.2766622Z OK
2020-06-12T17:55:27.2827712Z Package dir: /github/workspace
2020-06-12T17:55:27.4737719Z Because ir_sensor_plugin requires the Flutter SDK, version solving failed.
2020-06-12T17:55:27.4739592Z 
2020-06-12T17:55:27.4743315Z Flutter users should run `flutter pub get` instead of `pub get`.
2020-06-12T17:55:27.6977883Z Because ir_sensor_plugin requires the Flutter SDK, version solving failed.
2020-06-12T17:55:27.6982279Z 
2020-06-12T17:55:27.7000896Z Flutter users should run `flutter pub get` instead of `pub get`.
2020-06-12T17:55:27.9123248Z Could not find a file named "pubspec.yaml" in "/github/home/.pub-cache/hosted/pub.dartlang.org/async-2.4.1".
2020-06-12T17:55:27.9415574Z 
2020-06-12T17:55:27.9468996Z /entrypoint.sh: line 55: lines: bad array subscript
2020-06-12T17:55:28.1259968Z Post job cleanup.
2020-06-12T17:55:28.2318365Z [command]/usr/bin/git version
2020-06-12T17:55:28.2398522Z git version 2.27.0
2020-06-12T17:55:28.2432463Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2020-06-12T17:55:28.2475007Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2020-06-12T17:55:28.2747746Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-06-12T17:55:28.2782449Z http.https://github.com/.extraheader
2020-06-12T17:55:28.2790918Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-06-12T17:55:28.2831493Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2020-06-12T17:55:28.3185938Z Cleaning up orphan processes

Deploy latest versiΓ³n

Hi! Can you deploy the changes that enable Flutter in your package? And I forget add a entry in readme with format property :)

Credential path has changed

I was using what I was 100% sure were valid credentials with the latest stable flutter but was getting the "Pub needs your authorization to upload..." error.

Based on the answer to this question it appears that the path to the credential for Linux-based flutter is now ~/.config/dart/pub-credentials.json (which seems legit as on my Mac the path is the one listed there as well: ~/Library/Application Support/dart/pub-credentials.json)

I tried publishing a github action again manually putting the same credential json content the credential in this location via:

        mkdir -p ~/.config/dart/
        cat <<EOF > ~/.config/dart/pub-credentials.json
          ${{ secrets.CREDENTIAL_JSON }}
        EOF

and the publish worked.

Extract release notes as output

This is not a really big issue but more a feature request.

If possible, I want this action to be able to extract the release notes of the latest published version as the output.

Don't use the "name" input field, instead create a separate one

This is more of an aesthetic suggestion but can greatly improve the usability of the action when viewing the progress on the Actions page of Github.

Instead of relying on the name field for the package name, use a separate field, say packageName to capture the name of the package. The name field is used by Github to print the name of the action, which is a more user-friendly way of reading the step.

image

Notice in the above picture, the name of the package is the only one that shows up, which makes it difficult to know what the step is doing.

failure during the dart push with force enable to true

I have the following action that I want to build with force = true, but I receive a failure https://github.com/zino-hofmann/graphql-flutter/runs/7099897390?check_suite_focus=true

name: graphql Release Package

on:
  release:
    types: [created]
    tags:
      - graphql-v*
  push:
  workflow_run:
    workflows:
      - "graphql Test case"
      - "graphql Dart Code sanity check"
    branches: [ main ]
    types:
      - completed

jobs:
  publishing:
    runs-on: ubuntu-latest
    steps:
      - name: 'Checkout'
        uses: actions/checkout@v2 # required!

      - name: 'publish graphql to to Pub.dev'
        uses: k-paxian/dart-package-publisher@master
        with:
          credentialJson: ${{ secrets.CREDENTIAL_JSON }}
          flutter: false
          skipTests: true
          force: true
          dryRunOnly: ${{ github.event_name != 'release' }}
          relativePath: './packages/graphql/'

Add support for Flutter packages

It would be great if you could also support Flutter packages. Currently it fails with the following output:

Check inputs...
OK
Switching to package directory 'flutter_mobx'
Package dir: /github/workspace/flutter_mobx
Because flutter_mobx depends on flutter_test any from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.

Flutter users should run `flutter pub get` instead of `pub get`.
No pubspec.lock file found, please run "pub get" first.
/entrypoint.sh: line 35: lines: bad array subscript
##[error]Docker run failed with exit code 1

You can check if the package type is flutter by looking at the pubspec.yaml and seeing if there is a flutter sdk specified. For those cases, you can switch to flutter specific commands for get, test and publish

Failing for a missing "version" file ?

Here's the relevant log:

Run k-paxian/dart-package-publisher@master
/usr/bin/docker run --name dfbb2c8cfddd70640b69dcf1b0e8d71f2a0_d9063a --label 488dfb --workdir /github/workspace --rm -e INPUT_RELATIVEPATH -e INPUT_ACCESSTOKEN -e INPUT_REFRESHTOKEN -e INPUT_SUPPRESSBUILDRUNNER -e INPUT_FLUTTER -e INPUT_DRYRUNONLY -e INPUT_SKIPTESTS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/mobx.dart/mobx.dart":"/github/workspace" 488dfb:b2c8cfddd70640b69dcf1b0e8d71f2a0
Check inputs...
OK
Switching to package directory 'mobx'
Package dir: /github/workspace/mobx
Cannot open file, path = 'version' (OS Error: No such file or directory, errno = 2)
out: 
Package: 
Local version: []
No package found. :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.