diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 41280a53..a9da77ad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -74,11 +74,16 @@ jobs: run: | set -e mkdir -p $XDG_CONFIG_HOME/dart - echo '${{ secrets.CREDENTIAL_JSON }}' > "$XDG_CONFIG_HOME/dart/pub-credentials.json" + echo -n '${{ secrets.CREDENTIAL_JSON }}' > $XDG_CONFIG_HOME/dart/pub-credentials.json - name: Publish id: publish if: ${{ env.IS_VERSION_GREATER == 1 }} - run: bash tool/publish.sh ${{ matrix.package }} + run: | + set -e + pushd ${{ matrix.package }} || exit + yq -i 'del(.dependency_overrides)' pubspec.yaml + dart pub publish --force + popd || exit - name: Skip publish id: skip_publish if: ${{ env.IS_VERSION_GREATER == 0 }} @@ -87,4 +92,4 @@ jobs: id: cleanup if: ${{ always() }} run: | - rm -rf "$XDG_CONFIG_HOME/dart/pub-credentials.json" \ No newline at end of file + rm -rf $XDG_CONFIG_HOME/dart/pub-credentials.json diff --git a/.github/workflows/publish_dry_run.yml b/.github/workflows/publish_dry_run.yml index 14d51179..6ab66c84 100644 --- a/.github/workflows/publish_dry_run.yml +++ b/.github/workflows/publish_dry_run.yml @@ -70,8 +70,13 @@ jobs: - name: Publish (dry run) id: publish_dry_run if: ${{ env.IS_VERSION_GREATER == 1 }} - run: bash tool/publish.sh ${{ matrix.package }} --dry-run + run: | + set -e + pushd ${{ matrix.package }} || exit + yq -i 'del(.dependency_overrides)' pubspec.yaml + dart pub publish --dry-run + popd || exit - name: Skip publish (dry run) id: skip_publish_dry_run if: ${{ env.IS_VERSION_GREATER == 0 }} - run: echo "Skipping publish (dry run) for ${{ matrix.package }} because the version is not greater than the one on pub.dev" \ No newline at end of file + run: echo "Skipping publish (dry run) for ${{ matrix.package }} because the version is not greater than the one on pub.dev" diff --git a/chopper/pubspec.yaml b/chopper/pubspec.yaml index 0e86235c..5f57ccb0 100644 --- a/chopper/pubspec.yaml +++ b/chopper/pubspec.yaml @@ -25,5 +25,8 @@ dev_dependencies: lints: ^2.1.1 test: ^1.24.4 transparent_image: ^2.0.1 + chopper_generator: ^7.0.0 + +dependency_overrides: chopper_generator: path: ../chopper_generator diff --git a/chopper_built_value/pubspec.yaml b/chopper_built_value/pubspec.yaml index a59baadb..b23d0a66 100644 --- a/chopper_built_value/pubspec.yaml +++ b/chopper_built_value/pubspec.yaml @@ -21,6 +21,5 @@ dev_dependencies: lints: ^2.1.1 dependency_overrides: - # Comment before publish chopper: path: ../chopper diff --git a/chopper_generator/pubspec.yaml b/chopper_generator/pubspec.yaml index ac8b3aa7..4d541b87 100644 --- a/chopper_generator/pubspec.yaml +++ b/chopper_generator/pubspec.yaml @@ -26,6 +26,5 @@ dev_dependencies: test: ^1.24.4 dependency_overrides: - # Comment before publish chopper: path: ../chopper diff --git a/tool/publish.sh b/tool/publish.sh deleted file mode 100644 index f5b81db2..00000000 --- a/tool/publish.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e - -PKG=$1 -echo -e "\033[1mPKG: ${PKG}\033[22m" -pushd "${PKG}" - -sed '/Comment before publish$/,+2 d' pubspec.yaml > pubspec.temp.yaml -rm pubspec.yaml -mv pubspec.temp.yaml pubspec.yaml - -if [ "$2" == "--dry-run" ]; then - dart pub publish --dry-run -else - dart pub publish --force -fi - -popd \ No newline at end of file