Skip to content

Commit

Permalink
chore: Add semantic release to automatically cut releases, generate c…
Browse files Browse the repository at this point in the history
…hangelogs, and publish a new gem version after tests pass (#466)
  • Loading branch information
jkeen authored Mar 18, 2024
1 parent f68b61f commit 3f8b4a9
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Generate New Release

on:
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
persist-credentials: false
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Build
run: |
gem install bundler
git submodule update --init --recursive
bundle install --jobs 4 --retry 3
- 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 }}
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: node_modules/.bin/semantic-release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/spec/reports/
/gemfiles/*.lock
/tmp/
node_modules
.byebug_history
spec/.rspec-examples
spec/dummy/log/*
Expand Down
112 changes: 112 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"name": "graphiti",
"version": "1.4.0",
"repository": {
"type": "git",
"url": "git+https://github.com/jkeen/graphiti.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/graphiti-api/graphiti/issues"
},
"homepage": "https://graphiti.dev",
"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": [
"master",
"main",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"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",
"BREAKING CHANGE!",
"BREAKING CHANGES!",
"BREAKING!"
]
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogTitle": "graphiti changelog",
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md"
],
"message": "${nextRelease.version} CHANGELOG [skip ci]\n\n${nextRelease.notes}"
}
]
],
"debug": true,
"dryRun": false
}
}

0 comments on commit 3f8b4a9

Please sign in to comment.