Skip to content

Commit

Permalink
Configure semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeen committed Feb 12, 2023
1 parent 553dc38 commit a11584e
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Generate New Release

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: node_modules/.bin/semantic-release
53 changes: 53 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests
on:
push:
pull_request:
concurrency:
group: ci-tests-${{ github.ref }}-1
cancel-in-progress: true
jobs:
test:
name: Run Tests
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
ruby: [ '2.7' ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle Install
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run RSpec
run: bundle exec rspec -f j -o tmp/rspec_results.json -f p

- name: RSpec Report
uses: SonicGarden/rspec-report-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
json-path: tmp/rspec_results.json
if: always()
publish:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [test]
steps:
- name: Dispatch Release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Generate New Release
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions lib/fcc/station/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def related_translators
records.keys.map do |call|
RecordDelegate.new(ExtendedInfo.new(@service).find(call))
end.select { |f| f.status.upcase == "LIC" }
rescue
[]
end
end

Expand Down
92 changes: 92 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"name": "fcc",
"version": "1.x.x-semantic-release",
"repository": {
"type": "git",
"url": "git+https://github.com/jkeen/fcc.git"
},
"author": "jkeen",
"license": "MIT",
"bugs": {
"url": "https://github.com/jkeen/fcc/issues"
},
"homepage": "https://github.com/jkeen/fcc#readme",
"scripts": {
"semantic-release": "semantic-release"
},
"devDependencies": {
"semantic-release-rubygem": "^1.2.0",
"semantic-release": "^19.0.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1"
},
"release": {
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
"type": "*!",
"release": "major"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "build",
"release": "patch"
},
{
"type": "ci",
"release": "patch"
},
{
"type": "chore",
"release": "patch"
},
{
"type": "docs",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "style",
"release": "patch"
},
{
"type": "test",
"release": "patch"
}
],
"parserOpts": {
"noteKeywords": ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"]
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "fcc changelog",
"changelogFile": "CHANGELOG.md"
}
],
"semantic-release-rubygem",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": ["CHANGELOG.md"],
"message": "${nextRelease.version} CHANGELOG [skip ci]\n\n${nextRelease.notes}"
}
]
],
"debug": false,
"dryRun": false
}}

0 comments on commit a11584e

Please sign in to comment.