Skip to content

Commit a11584e

Browse files
committed
Configure semantic release
1 parent 553dc38 commit a11584e

File tree

4 files changed

+173
-0
lines changed

4 files changed

+173
-0
lines changed

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Generate New Release
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
persist-credentials: false
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 14
21+
- name: Install Dependencies
22+
run: yarn install --frozen-lockfile
23+
- name: Release
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: node_modules/.bin/semantic-release

.github/workflows/tests.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Tests
2+
on:
3+
push:
4+
pull_request:
5+
concurrency:
6+
group: ci-tests-${{ github.ref }}-1
7+
cancel-in-progress: true
8+
jobs:
9+
test:
10+
name: Run Tests
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ ubuntu-latest ]
15+
ruby: [ '2.7' ]
16+
runs-on: ${{ matrix.os }}
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: ${{ matrix.ruby }}
23+
- uses: actions/cache@v3
24+
with:
25+
path: vendor/bundle
26+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-gems-
29+
- name: Bundle Install
30+
run: |
31+
gem install bundler
32+
bundle install --jobs 4 --retry 3
33+
34+
- name: Run RSpec
35+
run: bundle exec rspec -f j -o tmp/rspec_results.json -f p
36+
37+
- name: RSpec Report
38+
uses: SonicGarden/rspec-report-action@v2
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
json-path: tmp/rspec_results.json
42+
if: always()
43+
publish:
44+
name: Release
45+
runs-on: ubuntu-latest
46+
if: github.ref == 'refs/heads/main'
47+
needs: [test]
48+
steps:
49+
- name: Dispatch Release
50+
uses: benc-uk/workflow-dispatch@v1
51+
with:
52+
workflow: Generate New Release
53+
token: ${{ secrets.GITHUB_TOKEN }}

lib/fcc/station/result.rb

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ def related_translators
7676
records.keys.map do |call|
7777
RecordDelegate.new(ExtendedInfo.new(@service).find(call))
7878
end.select { |f| f.status.upcase == "LIC" }
79+
rescue
80+
[]
7981
end
8082
end
8183

package.json

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"name": "fcc",
3+
"version": "1.x.x-semantic-release",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/jkeen/fcc.git"
7+
},
8+
"author": "jkeen",
9+
"license": "MIT",
10+
"bugs": {
11+
"url": "https://github.com/jkeen/fcc/issues"
12+
},
13+
"homepage": "https://github.com/jkeen/fcc#readme",
14+
"scripts": {
15+
"semantic-release": "semantic-release"
16+
},
17+
"devDependencies": {
18+
"semantic-release-rubygem": "^1.2.0",
19+
"semantic-release": "^19.0.3",
20+
"@semantic-release/changelog": "^6.0.1",
21+
"@semantic-release/git": "^10.0.1"
22+
},
23+
"release": {
24+
"branches": ["main"],
25+
"plugins": [
26+
[
27+
"@semantic-release/commit-analyzer",
28+
{
29+
"releaseRules": [
30+
{
31+
"type": "*!",
32+
"release": "major"
33+
},
34+
{
35+
"type": "feat",
36+
"release": "minor"
37+
},
38+
{
39+
"type": "build",
40+
"release": "patch"
41+
},
42+
{
43+
"type": "ci",
44+
"release": "patch"
45+
},
46+
{
47+
"type": "chore",
48+
"release": "patch"
49+
},
50+
{
51+
"type": "docs",
52+
"release": "patch"
53+
},
54+
{
55+
"type": "refactor",
56+
"release": "patch"
57+
},
58+
{
59+
"type": "style",
60+
"release": "patch"
61+
},
62+
{
63+
"type": "test",
64+
"release": "patch"
65+
}
66+
],
67+
"parserOpts": {
68+
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
69+
}
70+
}
71+
],
72+
"@semantic-release/release-notes-generator",
73+
[
74+
"@semantic-release/changelog",
75+
{
76+
"changelogTitle": "fcc changelog",
77+
"changelogFile": "CHANGELOG.md"
78+
}
79+
],
80+
"semantic-release-rubygem",
81+
"@semantic-release/github",
82+
[
83+
"@semantic-release/git",
84+
{
85+
"assets": ["CHANGELOG.md"],
86+
"message": "${nextRelease.version} CHANGELOG [skip ci]\n\n${nextRelease.notes}"
87+
}
88+
]
89+
],
90+
"debug": false,
91+
"dryRun": false
92+
}}

0 commit comments

Comments
 (0)