-
Notifications
You must be signed in to change notification settings - Fork 366
Fix the sass_api release #2557
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
Fix the sass_api release #2557
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This has to be a separate workflow to satisfy pub.dev's somewhat draconian | ||
# requirements for when and how GitHub actions are allowed publish packages. | ||
# Specifically, it requires that each publish action be triggered by a tag that | ||
# contains the version number for that action, so we can't just publish sass_api | ||
# as part of the standard sass release flow because that was triggered by a tag | ||
# with the sass version number. | ||
name: Release sass-api | ||
|
||
on: | ||
push: | ||
tags: ['sass-api-[0-9]+.[0-9]+.*'] | ||
|
||
jobs: | ||
deploy_sass_api: | ||
if: github.event.repository.fork == false | ||
name: Deploy sass_api | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/util/initialize | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Deploy | ||
run: dart run grinder deploy-sass-api | ||
env: | ||
PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}" | ||
GH_TOKEN: "${{ secrets.GH_TOKEN }}" | ||
GH_USER: sassbot |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,29 +95,25 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# We have to use this rather than the implicit GitHub token so that | ||
# pushing a new tag triggers another action. | ||
token: ${{ secrets.GH_TOKEN }} | ||
- uses: ./.github/util/initialize | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Deploy | ||
run: dart run grinder protobuf pkg-pub-deploy | ||
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"} | ||
|
||
deploy_sass_api: | ||
name: Deploy sass_api | ||
runs-on: ubuntu-latest | ||
needs: [deploy_pub] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/util/initialize | ||
with: {github-token: "${{ github.token }}"} | ||
|
||
- name: Deploy | ||
run: dart run grinder deploy-sass-api | ||
env: | ||
PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}" | ||
GH_TOKEN: "${{ secrets.GH_TOKEN }}" | ||
GH_USER: sassbot | ||
- name: Get Sass API version | ||
id: sass-api-version | ||
run: | | ||
echo "version=$(cat pkg/sass_api/pubspec.yaml | sed -nE 's/version: (.*)/\1/p')" | tee --append "$GITHUB_OUTPUT" | ||
# This should be /-separated rather than hyphenated, but pub.dev doesn't | ||
# currently allow that (dart-lang/pub-dev#8690). | ||
- run: git tag sass-api-${{ steps.sass-api-version.outputs.version }} | ||
- run: git push --tag | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to push with the implicit
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, another problem I remember is that pushing with implicit token won't trigger another workflow. So you probably should use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Isn't that inherited from the invocation in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Permission inheritance in reusable workflow is a bit complicated. The permission declared in parent workflow defines the maximum permission child workflows can ask for, but if a child workflow did not explicitly ask for the permission, it won't get inherited from parent automatically. https://docs.github.com/en/actions/sharing-automations/reusing-workflows#access-and-permissions Anyways, better to use a PAT so that it guarantee the push event triggers a new workflow. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it's now using the same setup as |
||
|
||
deploy_sass_parser: | ||
name: Deploy sass-parser | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.4.18 | ||
|
||
* No user-visible changes. | ||
|
||
## 0.4.17 | ||
|
||
* No user-visible changes. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 15.3.2 | ||
|
||
* No user-visible changes. | ||
|
||
## 15.3.1 | ||
|
||
* No user-visible changes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure, but another way this might be broken is that
git
might complain that "user" is not setup. Maybe we need to add these before creating the tag:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe lightweight tags don't include any author information. (Note that the git user isn't set when tagging
sass-parser
below.)