-
-
Notifications
You must be signed in to change notification settings - Fork 37
chore: Add publish script #151
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
Conversation
|
My impression of this is that it improves on the existing setup and as such wouldn't make it easier to recover from the issue that caused #153 – if that's so then I would suggest adapting to what I suggested there |
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@voxpelli You're saying that this improves the process but won't make it easier to recover? Can you explain? This process would have actually allowed |
|
@nzakas It doesn't split it up into individual GitHub Actions jobs as far as I understand, so it won't be any more possible to retry failed publishes individually, something that would have enabled a manual recover for the package that got a 503 reply |
|
@voxpelli Ah, I see what you mean. Yes, you're correct that this version does not. Retrying to publish a single dependency is something I was going to add in a second step once we've got this working. |
scripts/publish.js
Outdated
| //----------------------------------------------------------------------------- | ||
|
|
||
| /** | ||
| * Converts a GitHub Actions step output name to its corresponding environment variable name |
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.
Do GitHub Actions automatically set environment variables for step outputs? I couldn't find any docs about this. I tried the following and it didn't work:
name: Test Steps Output
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
steps:
- id: release
run: echo "packages/config-array--release_created=true" >> "$GITHUB_OUTPUT"
# prints "true"
- run: echo result from steps ${{ steps.release.outputs['packages/config-array--release_created'] }}
# prints nothing
- run: echo result from env $STEPS_RELEASE_OUTPUTS_PACKAGES__CONFIG_ARRAY__RELEASE_CREATED
# no env variable there
- run: exportThere 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.
Good question. I was trying to cobble this together from the (awful) GitHub workflows docs.
How are you testing?
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'm testing by running the above workflow. Here's a run example:
https://github.com/mdjermanovic/test-steps-env/actions/runs/13438455360/job/37546518902
${{ steps.release.outputs['packages/config-array--release_created'] }} works as expected, but it doesn't seem that $STEPS_RELEASE_OUTPUTS_PACKAGES__CONFIG_ARRAY__RELEASE_CREATED was set.
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.
Ah, I thought you might be running locally. 😄
It looks like my AI companion got this one wrong, I'll dig in.
|
Okay, I figured out how to pass all the step outputs into the script. Also wrote up a brief explainer on my website: https://humanwhocodes.com/snippets/2025/02/passing-github-action-step-output-to-script |
mdjermanovic
left a comment
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.
LGTM, thanks!
Prerequisites checklist
What is the purpose of this pull request?
Add a new script to simplify publishing packages.
What changes did you make? (Give an overview)
Added a new script that automatically calculates the correct publish order for packages in this repo. It also posts to social media once complete.
All npm packages are published first, followed by all JSR packages.
This should simplify publishing going forward and allow us to simplify the
release-please.ymlworkflow.For now, I've added this into
release-please.ymlin dry run mode so it just output the commands that it would otherwise execute. I figured we can do this for a couple of releases to ensure that the commands its intends to run are correct before switching over.Related Issues
Is there anything you'd like reviewers to focus on?