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

Delete dev dependency on Sass when releasing the embedded compiler #1850

Merged
merged 1 commit into from Dec 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -482,6 +482,8 @@ jobs:
repository: sass/dart-sass-embedded
token: ${{ secrets.GH_TOKEN }}
- uses: dart-lang/setup-dart@v1
- uses: frenck/action-setup-yq@v1
with: {version: v4.30.5} # frenck/action-setup-yq#35

- name: Get version
id: version
Expand All @@ -492,6 +494,25 @@ jobs:
sed -i 's/version: .*/version: ${{ steps.version.outputs.version }}/' pubspec.yaml
dart pub remove sass
dart pub add sass:${{ steps.version.outputs.version }}

# Delete a dependency override on Sass if it exists, and delete the
# dependency_overrides field if it's now empty. The embedded compiler
# often uses dev dependencies to run against the latest Dart Sass, but
# once we release the latest version that's no longer necessary.
#
# TODO(dart-lang/pub#3700): Use pub for this instead to avoid removing
# blank lines. See also mikefarah/yq#515.
yq -i '
del(.dependency_overrides.sass) |
to_entries |
map(select(.key != "dependency_overrides" or (.value | length >0))) |
from_entries
' pubspec.yaml

# The embedded compiler has a checked-in pubspec.yaml, so upgrade to
# make sure we're releasing against the latest version of all deps.
pub upgrade

curl https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md

- uses: EndBug/add-and-commit@v8
Expand Down