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

Automate workflow to publish to RubyGems. #2584

Merged
merged 7 commits into from
Oct 20, 2022

Conversation

bijoysijo
Copy link
Contributor

@bijoysijo bijoysijo commented Oct 7, 2022

Add Github action to automate publish to RubyGems on release / tag.

Fixes #2554

@bijoysijo bijoysijo changed the title Automate release 1 Update branch in automated release action. Oct 7, 2022
push:
tags:
- "v*"
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to push gem to rubygems.org when we merge any PR to main branch, I added this for my testing purpose. Make sure we need this before merging.

Other things I think are quite self explanatory, the only part I was stuck/unsure of how are we going to handle secrete tokens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I'll remove the pull_request part.

Copy link
Contributor

Choose a reason for hiding this comment

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

@vbrazo do we have the Ruby gem host key in the Settings? If not, we might need to add it for this to work.

Copy link
Member

Choose a reason for hiding this comment

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

I've just added it.

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

hi @bijoysijo thank you for your contribution to Faker! I left a comment, let me know what you think.

I am a bit confused by the description of this PR. The branch was renamed to main a couple of days ago. Could you please update the description with the reason why behind the changes? Thanks!

.github/workflows/publish.yml Show resolved Hide resolved
Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

this is a nice addition, thanks for working on this!

We don't need the deployment-action parts though, so I left a few suggestions.

Comment on lines 22 to 28
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
environment: production
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't have deployments or environments, so I don't think we need this step.

Comment on lines 43 to 59
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}

- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
Copy link
Contributor

Choose a reason for hiding this comment

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

same thing here, we don't have deployments nor notifications, so this is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update and push.

@thdaraujo thdaraujo requested a review from vbrazo October 12, 2022 23:59
@bijoysijo bijoysijo changed the title Update branch in automated release action. Automate workflow to publish to RubyGems. Oct 13, 2022
@bijoysijo
Copy link
Contributor Author

bijoysijo commented Oct 13, 2022

Hi, I've made the requested changes. Let me know if it needs more work. 😄

@stefannibrasil @thdaraujo

Copy link
Contributor

@thdaraujo thdaraujo 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!

Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

actually, forgot about one last thing: let's also add explicit permissions (see #2551 for reference)

.github/workflows/publish.yml Show resolved Hide resolved
@bijoysijo
Copy link
Contributor Author

@thdaraujo Everything look good? 😄

@Zeragamba
Copy link
Contributor

LGTM :)

Copy link
Contributor

@thdaraujo thdaraujo left a comment

Choose a reason for hiding this comment

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

🚀🚀🚀

Copy link
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

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

Thank you!

@stefannibrasil
Copy link
Contributor

Just waiting on @vbrazo about the keys.

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

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

The RubyGem key was added.

LGTM 👍

@vbrazo vbrazo merged commit 8b7c41e into faker-ruby:main Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automate RubyGems release using CI workflow
6 participants