Skip to content

Commit

Permalink
chore: integrate github actions and prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Apr 28, 2023
1 parent 5c6d18f commit cb47ce2
Show file tree
Hide file tree
Showing 17 changed files with 299 additions and 150 deletions.
5 changes: 5 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
exclude_paths:
- CHANGELOG.md

...
11 changes: 11 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": [
"config:base",
":semanticCommits",
":semanticCommitType(deps)",
":automergePatch"
],
"labels": [
"renovate"
]
}
66 changes: 66 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
repository:
name: po_to_json
description: Ruby library for converting gettext PO files to JSON
homepage: https://github.com/webhippie/po_to_json
topics: ruby, rubygem, gettext, i18n, json

private: false
has_issues: true
has_projects: false
has_wiki: false
has_downloads: false

default_branch: master

allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true

labels:
- name: bug
color: d73a4a
description: Something isn't working
- name: documentation
color: 0075ca
description: Improvements or additions to documentation
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: enhancement
color: a2eeef
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: help wanted
color: 008672
description: Extra attention is needed
- name: invalid
color: e4e669
description: This doesn't seem right
- name: question
color: d876e3
description: Further information is requested
- name: wontfix
color: ffffff
description: This will not be worked on
- name: hacktoberfest-accepted
color: cccccc
description: Accepted as a Hacktoberfest submission
- name: renovate
color: e99695
description: Automated action from Renovate

branches:
- name: master
protection:
required_status_checks:
strict: true
contexts: []
enforce_admins: false
restrictions:
users: []
teams: []

...
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: release

"on":
push:
tags:
- v*

jobs:
release:
runs-on: ubuntu-20.04

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Release gem
uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{ secrets.RUBYGEMS_API_KEY }}

...
75 changes: 75 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
name: testing

"on":
pull_request:
push:
branches:
- master

jobs:
rubocop:
runs-on: ubuntu-20.04

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.1
bundler: 1.17
bundler-cache: true

- name: Run rubocop
run: bundle exec rubocop

spec:
runs-on: ubuntu-20.04
needs: rubocop

strategy:
fail-fast: false

matrix:
ruby:
- "2.1"
- "2.5"
- "2.7"
- "3.0"
- "3.1"
json:
- "1.6"
- "1.7"
- "1.8"
- "2.0"
- "2.1"
- "2.2"
- "2.3"
- "2.4"
- "2.5"
- "2.6"
exclude:
- json: "2.6"
ruby: "2.1"
- json: "2.7"
ruby: "2.3"

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: 1.17
bundler-cache: true
env:
JSON_VERSION: ${{ matrix.json }}

- name: Run rspec
run: bundle exec rspec

...
45 changes: 39 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
---
AllCops:
TargetRubyVersion: 2.1

Gemspec/RequiredRubyVersion:
Enabled: false

Naming/HeredocDelimiterNaming:
Enabled: false

Layout/ElseAlignment:
Enabled: false

Style/StringLiterals:
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

Style/AlignParameters:
EnforcedStyle: with_fixed_indentation

Style/Documentation:
Enabled: false

Expand All @@ -19,18 +29,41 @@ Style/WordArray:
Style/PerlBackrefs:
Enabled: false

Style/ElseAlignment:
Enabled: false

Style/Next:
Enabled: false

Style/RegexpLiteral:
Enabled: false

Style/SymbolArray:
EnforcedStyle: brackets

Metrics/MethodLength:
CountComments: false
Max: 30

Metrics/ClassLength:
Max: 300

Metrics/AbcSize:
Max: 25

Metrics/PerceivedComplexity:
Max: 10

Metrics/BlockLength:
Max: 35
Exclude:
- "**/*_spec.rb"

Metrics/LineLength:
Exclude:
- "**/*_spec.rb"

Naming/VariableNumber:
EnforcedStyle: snake_case

Style/FormatStringToken:
EnforcedStyle: template

...
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.1.0](https://github.com/webhippie/po_to_json/releases/tag/v1.0.1) - 2023-04-28

* Optionally remove var keyword to use a global (@illiatdesdindes)

## [1.0.1](https://github.com/webhippie/po_to_json/releases/tag/v1.0.1) - 2015-11-03

* Stop using bundler within the core lib (@tboerger)
Expand Down
11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: UTF-8 -*-
# frozen_string_literal: true

#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
Expand Down Expand Up @@ -30,15 +31,15 @@ gem "json", "~> #{ENV["JSON_VERSION"]}" if ENV["JSON_VERSION"]

group :development do
gem "guard", require: false
gem "guard-rubocop", require: false
gem "guard-rspec", require: false
gem "guard-rubocop", require: false

gem "listen", "~> 3.0.7"
end

group :test do
gem "simplecov", require: false
gem "coveralls", require: false
gem "codeclimate-test-reporter", require: false
gem "rubocop", require: false
gem "simplecov", require: false
end

instance_eval(File.read("Gemfile.local")) if File.exist? "Gemfile.local"
35 changes: 0 additions & 35 deletions Guardfile

This file was deleted.

Loading

0 comments on commit cb47ce2

Please sign in to comment.