Skip to content

Conversation

@nzakas
Copy link
Member

@nzakas nzakas commented Feb 3, 2025

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.yml workflow.

For now, I've added this into release-please.yml in 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?

@voxpelli
Copy link

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>
@nzakas
Copy link
Member Author

nzakas commented Feb 12, 2025

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

@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 plugin-kit to be published, so I'm not sure I understand what you're saying.

@voxpelli
Copy link

@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

@nzakas
Copy link
Member Author

nzakas commented Feb 12, 2025

@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.

//-----------------------------------------------------------------------------

/**
* Converts a GitHub Actions step output name to its corresponding environment variable name
Copy link
Member

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: export

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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.

@nzakas
Copy link
Member Author

nzakas commented Feb 21, 2025

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

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit b8beecb into main Feb 22, 2025
18 checks passed
@mdjermanovic mdjermanovic deleted the publish-tool branch February 22, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

5 participants