Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👷 use yq to manipulate pubspec.yaml in publish CI #471

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -87,4 +92,4 @@ jobs:
id: cleanup
if: ${{ always() }}
run: |
rm -rf "$XDG_CONFIG_HOME/dart/pub-credentials.json"
rm -rf $XDG_CONFIG_HOME/dart/pub-credentials.json
9 changes: 7 additions & 2 deletions .github/workflows/publish_dry_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
run: echo "Skipping publish (dry run) for ${{ matrix.package }} because the version is not greater than the one on pub.dev"
3 changes: 3 additions & 0 deletions chopper/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion chopper_built_value/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ dev_dependencies:
lints: ^2.1.1

dependency_overrides:
# Comment before publish
chopper:
path: ../chopper
1 change: 0 additions & 1 deletion chopper_generator/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ dev_dependencies:
test: ^1.24.4

dependency_overrides:
# Comment before publish
chopper:
path: ../chopper
19 changes: 0 additions & 19 deletions tool/publish.sh

This file was deleted.