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

Publish on jsr #7

Open
rrd108 opened this issue Jun 3, 2024 · 11 comments
Open

Publish on jsr #7

rrd108 opened this issue Jun 3, 2024 · 11 comments
Assignees

Comments

@rrd108
Copy link
Owner

rrd108 commented Jun 3, 2024

No description provided.

rrd108 added a commit that referenced this issue Jun 3, 2024
rrd108 added a commit that referenced this issue Jun 3, 2024
@rrd108
Copy link
Owner Author

rrd108 commented Jun 3, 2024

@rrd108 rrd108 closed this as completed Jun 3, 2024
@rrd108 rrd108 reopened this Oct 7, 2024
@rrd108
Copy link
Owner Author

rrd108 commented Oct 7, 2024

@brenoepics can you look into this. I have tried quite a few variations but it always fails

@brenoepics
Copy link
Contributor

Hi, what is wrong with this?

@rrd108
Copy link
Owner Author

rrd108 commented Oct 8, 2024

the jsr publish fails. I modified a lot but still fails with different errors.

For example: https://github.com/rrd108/vue-mess-detector/actions/runs/11221618034/job/31192321609

@brenoepics
Copy link
Contributor

I fixed the action in a fork and managed to publish it, I've never used jsr, I don't know if I'm doing it wrong, but I believe that pnpm, npm... doesn't recognize @username/package as a command and tries to download it from npm central.

example

  1. publish to jsr
  2. npx jsr add @brenoepics/testing
  3. npx @brenoepics/testing analyze

Upon observing this, I thought about searching for jsr commands to see if there were any similar to a dlx, unfortunately, there aren't, I found an issue related to this.
jsr-io/jsr#157

@rrd108
Copy link
Owner Author

rrd108 commented Oct 10, 2024

https://jsr.io/docs/publishing-packages#publishing-from-github-actions

Here is the detailed info how to do this

@brenoepics
Copy link
Contributor

publishing is easy, actually it was just missing the node setup step, but running bin commands seems not possible.
working example:

name: JSR Publish

on:
  release:
    types: [ created ]

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write # The OIDC ID token is used for authentication with JSR.
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: yarn

      - run: |
          yarn install
          npx jsr publish --allow-dirty

@rrd108
Copy link
Owner Author

rrd108 commented Oct 13, 2024

on the new release it did not detected the version number bump, so the publish did not happened.

@brenoepics
Copy link
Contributor

The version bump was in the same commit as the tag/release?
as far as I remember, there are 3 release events: (or 4 idk if synchronize is one of them)

  release:
    types: [created, edited, published]

if the bump tag is in the same commit, you might want the published one?

@rrd108
Copy link
Owner Author

rrd108 commented Oct 14, 2024

no, the bump comes after the tag release

@rrd108
Copy link
Owner Author

rrd108 commented Oct 15, 2024

As I see it works but we are one relaese behind on jsr

I think I should change the jsr.json update in my release script, but I am nt sure how

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants