goenning / google-indexing-script

Script to get your site indexed on Google in less than 48 hours
https://seogets.com
MIT License
6.96k stars 483 forks source link

Add cli #31

Closed AntoineKM closed 8 months ago

AntoineKM commented 8 months ago

What did I change?

Why did I change it? Close: #22 And enable more global use in different projects.

goenning commented 8 months ago

Looks good overall, the the README will become very long with this change. I think we should only mention the recommended method (CLI), and maybe a link to alternatives installation methods which would be in a different fine, what you think?

I like the idea of having a ~/.gis folder :+1:

I think it should be possible to pass the path to the json as an argument as well, the variants would be:

gis seogets --path /path/to
or
gis seogets --client-email abc@example.com --private-key PRIVATE KEYS
or 
GOOGLE_CLIENT_EMAIL=abc GOOGLE_PRIVATE_KEY=test gis seogest
AntoineKM commented 8 months ago

Looks good overall, the the README will become very long with this change. I think we should only mention the recommended method (CLI), and maybe a link to alternatives installation methods which would be in a different fine, what you think?

I like the idea of having a ~/.gis folder 👍

I think it should be possible to pass the path to the json as an argument as well, the variants would be:

gis seogets --path /path/to
or
gis seogets --client-email abc@example.com --private-key PRIVATE KEYS
or 
GOOGLE_CLIENT_EMAIL=abc GOOGLE_PRIVATE_KEY=test gis seogest

I've added a few collapsed sections, made a few changes, after that, I'm not great at README / Documentation so if you want to make changes after the merge that would be welcome!

AntoineKM commented 8 months ago

I've also added the option for a custom path!

goenning commented 8 months ago

Amazing work @AntoineKM LGTM 🚀

AntoineKM commented 8 months ago

Thanks, that's it! I've even added a template for future pull requests, actions to check that the build doesn't fail. The only thing to do now is install this bot: https://github.com/changesets/bot and setup the secret variable NPM_TOKEN in the repo config!

prokopsimek commented 8 months ago

The NPM_TOKEN seems to be still missing so the package can't be published. https://github.com/goenning/google-indexing-script/actions/runs/8175267647/job/22351987709

Or is that caused that there is no tag in the repository yet?

Can't wait to use it such with one-line command npx google-indexing-script example.com! 🙌


As the owner of the SDK, you will need to set up secrets in your repository to store your npm token. Here are the steps to set up secrets:

  1. Sign up on https://www.npmjs.com/, go to your “Account” > “Access Tokens”, and generate a new Classic Token with type Automation (get more info here).
  2. In your repository on GitHub, where you want to set the automation, go to "Settings" > "Secrets and variables" > “Actions” and click on the "New repository secret" button.
  3. In the "Name" field, enter NPM_TOKEN.
  4. In the "Secret" field, paste the token you just created on npmjs.com.
  5. Click on the "Add secret" button to save your npm token as a secret.

Now your npm token is securely stored in your repository and can be accessed by your GitHub Action. When the GitHub Action runs, it will use the token to authenticate with the npm registry and publish your SDK.

Note that you should never share your npm token with anyone and avoid committing it to your codebase. By using secrets, you can ensure that your token is only accessible to authorized users and that it is not exposed in your code.

Source: https://www.dxheroes.io/blog/release-and-publish-a-new-javascript-sdk-version-automatically-a-step-by-step-guide

goenning commented 8 months ago

That's set up on the repo now, and the first version was released to NPM this morning

AntoineKM commented 8 months ago

That's set up on the repo now, and the first version was released to NPM this morning

Nice @goenning !

To prevent #35 failing, you also need to authorize this in the repo settings: image

Then try to rerun the action and it should work 😁

goenning commented 8 months ago

Done! It's all green now!

AntoineKM commented 7 months ago

@goenning I think the error keep happening due to this: https://stackoverflow.com/a/73155199/12379218