Skip to content

Commit b2c9e75

Browse files
committed
feat: initial commit
0 parents  commit b2c9e75

36 files changed

+1534
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: Conventional Commits And PR titles
3+
4+
on: # yamllint disable-line rule:truthy
5+
pull_request_target:
6+
types:
7+
- opened
8+
- edited
9+
- synchronize
10+
11+
jobs:
12+
comventional_commits:
13+
name: Validate Commit Subjects
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: webiny/[email protected]
18+
name: Validate Commit Subjects
19+
with:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
# All of the Angular commit types are allowed by default.
22+
# Added types to this:
23+
# * eyes - For observability related changes
24+
# * sec - For security related changes
25+
allowed-commit-types: "build,chore,ci,doc,documentation,docs,eyes,feat,fix,perf,refactor,revert,sec,style,test" # yamllint disable-line rule:line-length
26+
conventional_pr_title:
27+
name: Validate PR title
28+
runs-on: ubuntu-latest
29+
steps:
30+
-
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
id: validate-pr-title
34+
name: Validate PR title
35+
uses: amannn/action-semantic-pull-request@v5
36+
with:
37+
# All of the Angular commit types are allowed by default.
38+
# Added types to this:
39+
# * eyes - For observability related changes
40+
# * sec - For security related changes
41+
types: |
42+
build
43+
chore
44+
ci
45+
doc
46+
documentation
47+
docs
48+
eyes
49+
feat
50+
fix
51+
perf
52+
refactor
53+
revert
54+
sec
55+
style
56+
test
57+
# We don't enforce scopes
58+
# scopes:
59+
# - frontend
60+
# - backend
61+
# - ci
62+
# We don't disallow any scopes
63+
# disallowScopes: |
64+
# release
65+
wip: true

.github/workflows/gem.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Publish Ruby Gem
3+
on: # yamllint disable-line rule:truthy
4+
workflow_call:
5+
workflow_dispatch:
6+
jobs:
7+
publish_gem:
8+
name: Publish the gem to registries
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
registry:
13+
- key: rubygems
14+
secret: RUBYGEMS_TOKEN
15+
steps:
16+
-
17+
name: Checkout repository
18+
uses: actions/checkout@v4
19+
-
20+
name: Set up Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: 4.0.0
24+
bundler-cache: false
25+
-
26+
name: Publish to ${{ matrix.registry }}
27+
env:
28+
TRACE: ${{ secrets.ACTIONS_STEP_DEBUG || 'false' }}
29+
GEM_NAME: domeapi
30+
GEM_TOKEN: ${{ secrets[matrix.registry.secret] }}
31+
REGISTRY: ${{ matrix.registry.key }}
32+
run: |
33+
bundle install
34+
TRACE="$TRACE" GEM_TOKEN="$GEM_TOKEN" ./ci/publish-gem.sh "$REGISTRY"
35+
shell: bash

.github/workflows/main.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Ruby
2+
3+
on:
4+
workflow_call:
5+
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
name: Ruby ${{ matrix.ruby }}
12+
strategy:
13+
matrix:
14+
ruby:
15+
- '4.0.0'
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Ruby
19+
uses: ruby/setup-ruby@v1
20+
with:
21+
ruby-version: ${{ matrix.ruby }}
22+
bundler-cache: false
23+
- name: Install dependencies
24+
run: bundle install --jobs 4 --retry 3
25+
- name: Run the default task
26+
run: bundle exec rake

.github/workflows/publish.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Publish
3+
4+
on: # yamllint disable-line rule:truthy
5+
workflow_dispatch:
6+
workflow_call:
7+
8+
jobs:
9+
gem:
10+
name: Build and publish gem
11+
uses: ./.github/workflows/gem.yaml
12+
secrets: inherit

.github/workflows/release.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Release
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
workflow_call:
10+
11+
jobs:
12+
validate:
13+
name: Validations
14+
uses: ./.github/workflows/validations.yaml
15+
16+
release:
17+
needs: [validate]
18+
name: Create a release
19+
runs-on: ubuntu-latest
20+
outputs:
21+
release_created: ${{ steps.release.outputs.release_created }}
22+
steps:
23+
-
24+
uses: actions/checkout@v4
25+
id: git-checkout
26+
with:
27+
fetch-tags: true
28+
-
29+
uses: googleapis/release-please-action@v4
30+
id: release
31+
with:
32+
config-file: .release-please-config.json
33+
manifest-file: .release-please-manifest.json
34+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
35+
-
36+
id: debug
37+
env:
38+
RELEASE_CREATED: ${{ steps.release.outputs.release_created }}
39+
TRACE: ${{ secrets.ACTIONS_STEP_DEBUG || 'false' }}
40+
run: |
41+
if [ "$TRACE" != 'false' ]
42+
then
43+
printf 'Release created: %s\n' "$RELEASE_CREATED"
44+
fi
45+
46+
publish:
47+
if: needs.release.outputs.release_created
48+
needs: release
49+
name: Build and publish artifacts
50+
uses: ./.github/workflows/publish.yaml
51+
secrets: inherit

.github/workflows/validations.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Validations
3+
4+
on: # yamllint disable-line rule:truthy
5+
workflow_dispatch:
6+
workflow_call:
7+
pull_request:
8+
9+
jobs:
10+
validate_ruby:
11+
name: Ruby Tests
12+
uses: ./.github/workflows/main.yaml

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/

.release-please-config.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"packages": {
3+
".": {
4+
"changelog-path": "CHANGELOG.md",
5+
"release-type": "simple",
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"draft": false,
9+
"prerelease": false,
10+
"version-file": ".version.txt",
11+
"extra-files": [
12+
{
13+
"type": "generic",
14+
"path": "lib/domeapi/version.rb"
15+
}
16+
],
17+
"exclude-paths": [
18+
".release-please-manifest.json",
19+
".version.txt",
20+
"lib/domeapi/version.rb",
21+
".rubocop.yml",
22+
".overcommit.yml",
23+
"coverage/coverage.json"
24+
]
25+
}
26+
},
27+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
28+
}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

.rubocop.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
plugins:
3+
- rubocop-minitest
4+
- rubocop-performance
5+
- rubocop-rake
6+
7+
AllCops:
8+
TargetRubyVersion: 4
9+
NewCops: enable
10+
SuggestExtensions: false
11+
12+
Metrics/ClassLength:
13+
CountAsOne: ['array', 'heredoc', 'hash']
14+
Max: 115
15+
16+
Metrics/ModuleLength:
17+
CountAsOne: ['array', 'heredoc', 'hash']
18+
Max: 115
19+
Exclude:
20+
- 'spec/**/*.rb'
21+
22+
Metrics/MethodLength:
23+
CountAsOne: ['array', 'heredoc', 'hash']
24+
25+
Metrics/BlockLength:
26+
CountAsOne: ['array', 'heredoc', 'hash']
27+
Exclude:
28+
- 'test/**/*'
29+
- '*.gemspec'
30+
31+
Layout/LineLength:
32+
Max: 120
33+
AllowedPatterns: ['\A#']
34+
35+
Style/CommentedKeyword:
36+
Enabled: false
37+
38+
Style/StringLiterals:
39+
Enabled: true
40+
EnforcedStyle: single_quotes
41+
42+
Style/StringLiteralsInInterpolation:
43+
Enabled: true
44+
EnforcedStyle: double_quotes

0 commit comments

Comments
 (0)