Skip to content

Commit afdbf41

Browse files
Merge pull request #50 from fatzebra/PENG-387_fixup_public_gem
Attempting to do multi-ruby-version-builds
2 parents de993a4 + 6d22014 commit afdbf41

26 files changed

+514
-3493
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/.pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Pull Request
3+
about: Propose a change to the code repository
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
## 📝 Description
11+
<!-- Link to the issue related to this work -->
12+
Issue Reference: <ISSUE_REFERENCE>
13+
14+
<!-- What and why is this change being made? -->
15+
Details of change
16+
- <CHANGE_DETAIL_1>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. ...
16+
2. ...
17+
18+
**Expected behavior**
19+
A clear and concise description of what you expected to happen.
20+
21+
**Runtime environment**
22+
23+
- Version of the gem in use
24+
- Ruby version in use
25+
- OS that issues was seen under
26+
27+
**Additional context**
28+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: /gemfiles/ruby3.2
5+
schedule:
6+
interval: weekly
7+
groups:
8+
non-major-dependencies:
9+
update-types:
10+
- "minor"
11+
- "patch"
12+
- package-ecosystem: bundler
13+
directory: /gemfiles/ruby3.3
14+
schedule:
15+
interval: weekly
16+
groups:
17+
non-major-dependencies:
18+
update-types:
19+
- "minor"
20+
- "patch"
21+
- package-ecosystem: bundler
22+
directory: /gemfiles/ruby3.4
23+
schedule:
24+
interval: weekly
25+
groups:
26+
non-major-dependencies:
27+
update-types:
28+
- "minor"
29+
- "patch"

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: build and test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*.*.*'
9+
pull_request:
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
ruby-version:
17+
- 3.2
18+
- 3.3
19+
- 3.4
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Ruby and Install Gem
24+
uses: ruby/setup-ruby@v1
25+
env:
26+
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
27+
with:
28+
ruby-version: ${{ matrix.ruby-version }}
29+
bundler-cache: true
30+
31+
- name: Run rubocop
32+
env:
33+
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
34+
run: |
35+
bundle exec rubocop
36+
37+
- name: Run rspec test
38+
env:
39+
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
40+
run: |
41+
bundle exec rspec
42+
43+
publish-gem:
44+
runs-on: ubuntu-latest
45+
if: startsWith(github.ref, 'refs/tags/')
46+
environment: release
47+
permissions:
48+
id-token: write
49+
needs:
50+
- build-and-test
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Validate Base Ref
55+
id: validate_base_ref
56+
env:
57+
JSON_ENV_VARS: ${{ inputs.credentials_json }}
58+
shell: bash
59+
run: |
60+
if [ "${{ github.event.base_ref }}" != "refs/heads/main" ]; then
61+
echo "Only main branch tags can be published"
62+
echo "Tag's BASE_REF [${{ github.event.base_ref }}] is not [refs/heads/main]"
63+
exit 1
64+
fi
65+
66+
- name: Validate Tag
67+
id: validate_tag
68+
uses: rubenesp87/semver-validation-action@1aa67a60c04f1f6cccd1bcd93885f25f612bcc35
69+
with:
70+
version: ${{ github.ref_name }}
71+
72+
- name: Update version
73+
shell: bash
74+
run: |
75+
echo "Using TAG ${{ github.ref_name }}"
76+
sed -i "s/0.0.0.pre.build/${{ github.ref_name }}/" lib/fat_zebra/version.rb
77+
78+
- name: Configure trusted publishing credentials
79+
uses: rubygems/configure-rubygems-credentials@v1.0.0
80+
81+
- name: Build and publish
82+
shell: bash
83+
run: |
84+
gem build
85+
gem push *.gem
86+
env:
87+
GIT_AUTHOR_NAME: Fat Zebra
88+
GIT_AUTHOR_EMAIL: support@fatzebra.com

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
*.gem
22
.bundle
3-
Gemfile.lock
43
pkg/*
54
.yardoc
65
doc/

.rubocop.yml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
1+
AllCops:
2+
NewCops: enable
3+
SuggestExtensions: false
4+
TargetRubyVersion: 3.2
5+
Exclude:
6+
- vendor/**/*
7+
- spec/**/*
8+
19
Layout/EmptyLinesAroundClassBody:
210
Enabled: false
311
Layout/EmptyLinesAroundModuleBody:
412
Enabled: false
5-
Layout/EmptyLinesAroundBlockBody:
6-
Enabled: false
13+
Layout/LineLength:
14+
Max: 200
715

16+
Style/Documentation:
17+
Enabled: false
18+
Style/MapIntoArray:
19+
Enabled: false
820
Style/MissingRespondToMissing:
921
Enabled: false
22+
Style/NumericPredicate:
23+
Enabled: false
24+
Style/SuperArguments:
25+
Enabled: false
26+
1027
Lint/MissingSuper:
1128
Enabled: false
12-
Style/NumericPredicate:
29+
30+
Gemspec/DevelopmentDependencies:
1331
Enabled: false
1432

1533
Metrics/AbcSize:
16-
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
17-
# a Float.
1834
Max: 27
19-
Metrics/LineLength:
20-
Max: 200
2135
Metrics/ClassLength:
2236
CountComments: false
2337
Max: 200
2438
Metrics/MethodLength:
2539
CountComments: false
2640
Max: 25
27-
Metrics/ModuleLength:
28-
CountComments: false
29-
Max: 200
30-
Metrics/CyclomaticComplexity:
31-
Max: 7
3241

33-
Documentation:
42+
Naming/PredicateMethod:
3443
Enabled: false
35-
36-
AllCops:
37-
TargetRubyVersion: 2.7
38-
Exclude:
39-
- bin/**/*
40-
- vendor/**/*
41-
- tmp/**/*
42-
- spec/**/*

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)