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

Add workflow for auto publishing the repo to NPM #2

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

tgolen
Copy link
Contributor

@tgolen tgolen commented Jul 24, 2023

This PR implements a GitHub workflow that automatically publishes a new version of the library to NPM every time a PR is merged to main. This flow was copied from react-native-onyx.

Tests

None. This can only be tested once it is merged. Then we will see if it works or not!

QA

  • Check the GH actions to see if it ran without any errors
  • Look in https://www.npmjs.com/ to see if the package was properly published

@tgolen tgolen self-assigned this Jul 24, 2023
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
gpg --import OSBotify-private-key.asc
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

Choose a reason for hiding this comment

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

Just making sure this secret was added to the repo via Ring0?

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn't, no. Is there anything you'd be able to point me to with instructions on what Ring0 needs to do exactly?

Choose a reason for hiding this comment

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

Here is an example issue: https://github.com/Expensify/Expensify/issues/288197

LARGE_SECRET_PASSPHRASE is in 1Password, so Ring0 will be able to find it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, thanks. I opened this issue to have them added: https://github.com/Expensify/Expensify/issues/302806

--body "Update version to ${{ env.NEW_VERSION }}"
sleep 5
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

Choose a reason for hiding this comment

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

This secret too?

Choose a reason for hiding this comment

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

+1

.github/workflows/publish.yml Show resolved Hide resolved
.github/workflows/publish.yml Outdated Show resolved Hide resolved
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output OSBotify-private-key.asc OSBotify-private-key.asc.gpg
gpg --import OSBotify-private-key.asc
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}

Choose a reason for hiding this comment

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

+1

--body "Update version to ${{ env.NEW_VERSION }}"
sleep 5
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}

Choose a reason for hiding this comment

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

+1

@tgolen
Copy link
Contributor Author

tgolen commented Jul 25, 2023

@AndrewGable Any idea what's wrong with the CLA workflow? https://github.com/Expensify/react-native-x-maps/actions/runs/5659066613/job/15331799891 It wasn't failing on the PR where the workflow was added.

@AndrewGable
Copy link

Copy link

@luacmartins luacmartins left a comment

Choose a reason for hiding this comment

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

Changes LGTM. Just need to wait on adding the secrets to the repo before we can merge this.

Copy link

@AndrewGable AndrewGable left a comment

Choose a reason for hiding this comment

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

Agree with @luacmartins, let's merge once secrets are added.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 25, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@tgolen
Copy link
Contributor Author

tgolen commented Jul 25, 2023

I have read the CLA Document and I hereby sign the CLA

@tgolen
Copy link
Contributor Author

tgolen commented Jul 25, 2023

OK, tests are all passing now so I will merge and see what happens with the NPM publishing.

@tgolen tgolen merged commit 0a683fd into main Jul 25, 2023
2 checks passed
@tgolen tgolen deleted the tgolen-auto-npmpublish branch July 25, 2023 18:24
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

Successfully merging this pull request may close these issues.

3 participants