-
Notifications
You must be signed in to change notification settings - Fork 368
Import trusted publisher jobs from ruby/psych #844
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Publish gem to rubygems.org | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| push: | ||
| if: github.repository == 'ruby/json' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| environment: | ||
| name: rubygems.org | ||
| url: https://rubygems.org/gems/json | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| strategy: | ||
| matrix: | ||
| ruby: ["ruby", "jruby"] | ||
|
|
||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
|
||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
|
|
||
| # https://github.com/rubygems/rubygems/issues/5882 | ||
| - name: Install dependencies and build for JRuby | ||
| run: | | ||
| sudo apt install default-jdk maven | ||
| gem update --system | ||
| gem install ruby-maven rake-compiler --no-document | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure we need this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also worried |
||
| rake compile | ||
| if: matrix.ruby == 'jruby' | ||
|
|
||
| - name: Install dependencies | ||
| run: bundle install --jobs 4 --retry 3 | ||
|
Comment on lines
+50
to
+51
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can combine this with the - name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For regular CI: #845
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know that but
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's very annoying.... But I just pushed that change on regular CI and it seems to work? |
||
|
|
||
| - name: Publish to RubyGems | ||
| uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1 | ||
|
|
||
| - name: Create GitHub release | ||
| run: | | ||
| tag_name="$(git describe --tags --abbrev=0)" | ||
| gh release create "${tag_name}" --verify-tag --generate-notes | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| if: matrix.ruby != 'jruby' | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need to use
setup-ruby-pkgbecause JRuby needsragel: