Git Product home page Git Product logo

Comments (12)

dentarg avatar dentarg commented on June 29, 2024

Docs that should be updated if/when changes are made: https://github.com/sinatra/sinatra/blob/main/RELEASING.md

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

It is possible to create RubyGems API keys scoped to only pushing a specific gem (https://rubygems.org/profile/api_keys). If "MFA Level" is set to UI and gem signin I believe it is possible to push the gem from CI. API keys are personal though, as RubyGems.org does not have the concept of organisations/teams. We would need to maintain some mapping per maintainer in Actions secrets. Could it work?

This may not be compatible with rubygems_mfa_required https://guides.rubygems.org/mfa-requirement-opt-in/

Maybe a Actions workflow manually triggered (workflow_dispatch) that takes the OTP as input could work.

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

Some more RubyGems.org/MFA links: https://blog.rubygems.org/2022/08/22/mfa-ui-only-removed.html, https://blog.rubygems.org/2022/08/15/requiring-mfa-on-popular-gems.html

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

Interesting, Jekyll pushes with https://rubygems.org/profiles/jekyllbot

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

Maybe wait for rubygems/rfcs#49

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

Maybe wait for rubygems/rfcs#49

The implementation is at rubygems/rubygems.org#3716, sounds like it is pretty close to be merged, I think we can ask to beta test it after that

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

This is the action to use https://github.com/rubygems/configure-rubygems-credentials

https://www.youtube.com/watch?v=kaRhg3QDzFY mentions it is possible to reach out to the Bundler team if you want to test this, will do

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

https://github.com/svenfuchs/gem-release looks really interesting

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

Experimented with the above plugin and the RubyGems OIDC feature (https://rubygems.org/profile/oidc/api_key_roles/) for this dummy gem: https://github.com/spinels/spinels, https://rubygems.org/gems/spinels

Here's the workflow: https://github.com/spinels/spinels/blob/be054df398b3958497d92ba9c910f53f84792286/.github/workflows/release.yml

You can see an example run at https://github.com/spinels/spinels/actions/runs/7076441331/job/19259685180

Creating a release was done with the GitHub CLI: gh workflow run release.yml && sleep 2 && gh run watch --interval 1 --exit-status $(gh run list --workflow=release.yml --limit 1 --json databaseId --jq '.[].databaseId')

Used info from the actions event as the git author info: https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-email-preferences/setting-your-commit-email-address#about-commit-email-addresses. It is possible to become even more fancy with this: https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-on-behalf-of-an-organization


Additional useful link: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

We still have the protected main branch so we can't use https://github.com/svenfuchs/gem-release to bump the version in git main from actions. Creating the signed git tag (git tag -s) should still probably happen locally. We could have a workflow triggered when the tag is pushed. The workflow can run bundle exec rake install:all and the gem pushes. Before that, maintainer will have to open PR with version bump (and changelog update).

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

https://blog.rubygems.org/2023/12/14/trusted-publishing.html

from sinatra.

dentarg avatar dentarg commented on June 29, 2024

https://blog.rubygems.org/2023/12/14/trusted-publishing.html

Tested that in https://github.com/spinels/slenips. https://rubygems.org/gems/slenips shows :octocat: under "Pushed By".

There is a difference between "OIDC API Key Roles" and "Trusted Publishers":

yes, they are separate features. api key roles are tied to a user, trusted publishers are tied to a gem

from sinatra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.