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

Update protocol-version during embedded-host-node release #2097

Merged
merged 2 commits into from
Sep 27, 2023
Merged
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
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,9 @@ jobs:

- name: Get version
id: version
run: echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT"
run: |
echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT"
echo "protocol_version=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/sass/HEAD/spec/EMBEDDED_PROTOCOL_VERSION)" | tee --append "$GITHUB_OUTPUT"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: curl -fsSL is commonly used in scripting:

-f: Fail fast with no output at all on server errors.
-s: Silent or quiet mode. Do not show progress meter or error messages.
-S: When used with -s, --silent, it makes curl show an error message if it fails.
-L: If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request on the new place.


- name: Update version
run: |
Expand All @@ -632,13 +634,14 @@ jobs:

# Update main package version and dependencies on binary packages
cat package.json |
jq --arg version ${{ steps.version.outputs.version }} '
jq --arg version ${{ steps.version.outputs.version }} --arg protocol_version ${{ steps.version.outputs.protocol_version }} '
.version |= $version |
."compiler-version" |= $version |
."protocol-version" |= $protocol_version |
.optionalDependencies = (.optionalDependencies | .[] |= $version)
' > package.json.tmp &&
mv package.json.tmp package.json
curl https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md
curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md
shell: bash

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