-
Notifications
You must be signed in to change notification settings - Fork 3
Move CI to github #65
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
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,77 @@ | ||||||||||||||||||||||
| name: CI | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| push: | ||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| lint: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||||
|
Comment on lines
+16
to
+19
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Run RuboCop | ||||||||||||||||||||||
| run: bundle exec rubocop | ||||||||||||||||||||||
|
Comment on lines
+13
to
+22
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| test: | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||
| ruby-version: ['3.2', '3.3'] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| ruby-version: ${{ matrix.ruby-version }} | ||||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||
| run: bundle exec rake spec | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| publish: | ||||||||||||||||||||||
| needs: [lint, test] | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||
| packages: write | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Build gem | ||||||||||||||||||||||
| run: bundle exec rake build | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Publish to GitHub Packages | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| mkdir -p ~/.gem | ||||||||||||||||||||||
| cat << EOF > ~/.gem/credentials | ||||||||||||||||||||||
| --- | ||||||||||||||||||||||
| :github: Bearer ${GITHUB_TOKEN} | ||||||||||||||||||||||
| EOF | ||||||||||||||||||||||
| chmod 0600 ~/.gem/credentials | ||||||||||||||||||||||
| gem push --key github --host https://rubygems.pkg.github.com/RaspberryPiFoundation pkg/*.gem | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: Create GitHub Release | ||||||||||||||||||||||
| uses: softprops/action-gh-release@v1 | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| files: pkg/*.gem | ||||||||||||||||||||||
| generate_release_notes: true | ||||||||||||||||||||||
|
Comment on lines
+73
to
+77
|
||||||||||||||||||||||
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: pkg/*.gem | |
| generate_release_notes: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: pkg/*.gem | |
| generate_release_notes: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| AllCops: | ||
| TargetRubyVersion: 2.5 | ||
| inherit_from: .rubocop_todo.yml | ||
|
|
||
| Metrics/LineLength: | ||
| Max: 120 | ||
| AllCops: | ||
| NewCops: enable |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # This configuration was generated by | ||
| # `rubocop --auto-gen-config` | ||
| # on 2026-02-12 17:07:44 UTC using RuboCop version 1.84.2. | ||
| # The point is for the user to remove these configuration records | ||
| # one by one as the offenses are removed from the code base. | ||
| # Note that changes in the inspected code, or installation of new | ||
| # versions of RuboCop, may require this file to be generated again. | ||
|
|
||
| # Offense count: 4 | ||
| # Configuration parameters: EnforcedStyle, AllowedGems. | ||
| # SupportedStyles: Gemfile, gems.rb, gemspec | ||
| Gemspec/DevelopmentDependencies: | ||
| Exclude: | ||
| - 'kramdown_rpf.gemspec' | ||
|
|
||
| # Offense count: 1 | ||
| Gemspec/RequiredRubyVersion: | ||
| Exclude: | ||
| - 'kramdown_rpf.gemspec' | ||
|
|
||
| # Offense count: 7 | ||
| # Configuration parameters: AllowedMethods. | ||
| # AllowedMethods: enums | ||
| Lint/ConstantDefinitionInBlock: | ||
| Exclude: | ||
| - 'spec/errors_spec.rb' | ||
| - 'spec/i18n_spec.rb' | ||
| - 'spec/kramdown_rpf_spec.rb' | ||
|
|
||
| # Offense count: 3 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. | ||
| Metrics/AbcSize: | ||
| Max: 33 | ||
|
|
||
| # Offense count: 2 | ||
| # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
| # AllowedMethods: refine | ||
| Metrics/BlockLength: | ||
| Max: 55 | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns. | ||
| Metrics/CyclomaticComplexity: | ||
| Max: 13 | ||
|
|
||
| # Offense count: 8 | ||
| # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
| Metrics/MethodLength: | ||
| Max: 29 | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: CountComments, CountAsOne. | ||
| Metrics/ModuleLength: | ||
| Max: 163 | ||
|
|
||
| # Offense count: 1 | ||
| # Configuration parameters: AllowedMethods, AllowedPatterns. | ||
| Metrics/PerceivedComplexity: | ||
| Max: 14 | ||
|
|
||
| # Offense count: 6 | ||
| # Configuration parameters: AllowedConstants. | ||
| Style/Documentation: | ||
| Exclude: | ||
| - 'spec/**/*' | ||
| - 'test/**/*' | ||
| - 'lib/kramdown_rpf/kramdown.rb' | ||
| - 'lib/kramdown_rpf/rpf.rb' | ||
|
|
||
| # Offense count: 2 | ||
| # This cop supports safe autocorrection (--autocorrect). | ||
| # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings. | ||
| # URISchemes: http, https | ||
| Layout/LineLength: | ||
| Max: 136 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| ruby 2.7.2 | ||
| ruby 3.2.7 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,5 @@ source 'https://rubygems.org' | |
|
|
||
| # Specify your gem's dependencies in kramdown_rpf.gemspec | ||
| gemspec | ||
|
|
||
| gem 'rubocop', '~> 1.84' | ||
|
Comment on lines
6
to
+8
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,9 +17,10 @@ Gem::Specification.new do |spec| | |||||||
| # to allow pushing to a single host or delete this section to allow pushing to any host. | ||||||||
| if spec.respond_to?(:metadata) | ||||||||
| spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" | ||||||||
| spec.metadata['rubygems_mfa_required'] = 'true' | ||||||||
| else | ||||||||
| raise 'RubyGems 2.0 or newer is required to protect against ' \ | ||||||||
| 'public gem pushes.' | ||||||||
| 'public gem pushes.' | ||||||||
| end | ||||||||
|
|
||||||||
| spec.files = `git ls-files -z`.split("\x0").reject do |f| | ||||||||
|
|
@@ -31,6 +32,7 @@ Gem::Specification.new do |spec| | |||||||
|
|
||||||||
| spec.add_dependency 'i18n', '0.8.6' | ||||||||
| spec.add_dependency 'kramdown', '~> 1.2', '>= 1.2.0' | ||||||||
| spec.add_dependency 'rexml', '~> 3.4' | ||||||||
|
|
||||||||
|
Comment on lines
+35
to
36
|
||||||||
| spec.add_dependency 'rexml', '~> 3.4' | |
| spec.add_development_dependency 'rexml', '~> 3.4' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module KramdownRPF | ||
| VERSION = '0.11.8'.freeze | ||
| VERSION = '0.11.8' | ||
| end |
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.
The workflow is configured to run on pushes to the
mainbranch only, so it will not run on tag pushes. As a result, thepublishjob guarded bystartsWith(github.ref, 'refs/tags/v')will never execute. Add apush.tagstrigger (e.g.,v*) or remove the branch-only restriction if you want tag builds to publish.