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

ci/gem-push.yml setup-ruby fix #2443

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
10 changes: 4 additions & 6 deletions ci/gem-push.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Ruby Gem

on:
push:
branches: [ $default-branch ]
pull_request:
Copy link
Author

@MayCXC MayCXC Jun 29, 2024

Choose a reason for hiding this comment

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

I removed this because it is very unusual to publish unapproved contributions as a package from a CI workflow. This leads to cases where e.g a gem gets published to rubygems before its code is reviewed, and then even if it is approved, an error is raised when it gets published again with the same version on merge. An alternative would be to disable just the "Publish to RubyGems" step on PR.

Copy link
Author

@MayCXC MayCXC Jun 29, 2024

Choose a reason for hiding this comment

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

or, it may be better to use a release trigger like in npm-publish.yml

Copy link

@janbrasna janbrasna Aug 15, 2024

Choose a reason for hiding this comment

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

… or in pypa/python publihsing. Yes, this should be updated to trigger on GH Release publish:

"Packaging workflows should run on release with types: [ created ]"

Copy link
Author

Choose a reason for hiding this comment

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

cool, it uses a release trigger now.

Choose a reason for hiding this comment

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

+1

branches: [ $default-branch ]
release:
types: [created]

jobs:
build:
build-and-publish:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
Expand All @@ -22,7 +20,7 @@ jobs:
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: 2.6.x
ruby-version: "2.6"
Copy link
Author

Choose a reason for hiding this comment

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

in my tests 2.6.x is not a valid input for ruby/setup-ruby, but 2.6 is.


- name: Publish to GPR
run: |
Expand Down