Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Support publishing to the GitHub Package Registry #11

Closed
shawnbot opened this issue May 15, 2019 · 3 comments
Closed

Support publishing to the GitHub Package Registry #11

shawnbot opened this issue May 15, 2019 · 3 comments
Labels
enhancement New feature or request fr-skip

Comments

@shawnbot
Copy link
Contributor

There are several ways to do this, but if we're going to support publishing to both npm and GPM (sorry) automatically we'll need to do one of the following:

  1. Add instructions for publishing to GPM. Luckily, our entrypoint started as a copy of the one from actions/npm, so we already support custom values for NPM_REGISTRY_URL. In other words, all you should have to do is add this to your workflow:

    action "gpm publish" {
      uses = "primer/publish"
      env = {
        NPM_REGISTRY_URL = "<gpm registry url here>",
      }
      secrets = [
        "NPM_AUTH_TOKEN" # your GitHub access token w/necessary permissions
      ]
    }
  2. Update this action to publish to GPM. We would need to add a level of abstraction around publishing to multiple registries, each with their own auth token. For instance: we might only publish to npm if NPM_AUTH_TOKEN is set, and/or to GPM if GPM_AUTH_TOKEN is set.

  3. Write a new CLI that runs both of them, then call that from the action. In other words, every instance of npm publish becomes gpm publish here. I haven't looked yet, but this may already exist.

@shawnbot shawnbot added the enhancement New feature or request label May 15, 2019
@shawnbot
Copy link
Contributor Author

My vote would be to try option number 1 in one of our repos. Assuming GPM respects dist-tags (😬), it should just work.

@erictuvesson
Copy link

Hey, have you looked more on this @shawnbot ?

@shawnbot
Copy link
Contributor Author

@erictuvesson Yes! @emplums started working on this over in primer/react#450, but with Actions v2 (and GPR going into public beta) we'll need to revisit that change and test it again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request fr-skip
Projects
None yet
Development

No branches or pull requests

3 participants