Skip to content

Commit

Permalink
ci: release automation on next branch (#52)
Browse files Browse the repository at this point in the history
Co-authored-by: warbhe-amit <[email protected]
  • Loading branch information
cletustboone authored Sep 1, 2022
1 parent c5f7f4e commit 5d25617
Show file tree
Hide file tree
Showing 10 changed files with 19,216 additions and 9,401 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["@commitlint/config-conventional"] }
15 changes: 13 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
name: Node.js CI

on:
workflow_dispatch:
push:
branches-ignore: [ main ]
pull_request:
types:
- opened
branches: [ main ]

env:
HUSKY: 0
# Turns off installing commit hooks in CI environments

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [lts/*]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -28,5 +33,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# For the core sdk, simply running npm ci triggers a bunch of valiations to be run
- run: npm ci
- run: npm run fs:setup
- run: npm run validate:each
- run: npm run build:sdk
- run: npm run dist:declarations
- run: npm run dist:sdk
- run: npm run test

44 changes: 44 additions & 0 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release to GitHub
on:
workflow_dispatch:
env:
HUSKY: 0
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
- name: Setup project
run: npm run fs:setup
- name: Validate each OpenRPC spec
run: npm run validate:each
- name: Build fully assembled OpenRPC spec
run: npm run build:openrpc
- name: Validate fully assembled OpenRPC spec
run: npm run validate:assembled
- name: Build JavaScript SDK
run: |
npm run build:sdk
npm run dist:sdk
- name: Generate TypeScript declarations
run: npm run dist:declarations
- name: Run JavaScript SDK unit tests
run: npm run test
- name: Build markdown docs
run: |
npm run build:docs
npm run dist:docs
- name: Release to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit "$1"
56 changes: 56 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"branches": [
"main",
{
"name": "next",
"prerelease": true
},
{
"name": "next-major",
"prerelease": true
}
],
"dryRun": false,
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits"
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/github",
{
"assets": [
{
"path": "dist/**",
"label": "JavaScript SDK, Markdown Docs, Fully Assembled Firebolt Spec"
}
]
}
],
[
"@semantic-release/git",
{
"assets": [
"src/**",
"package.json",
"package-lock.json",
"CHANGELOG.md",
"CONTRIBUTING.md",
"LICENSE",
"NOTICE",
"COPYING"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
23 changes: 22 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,25 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


MIT License

Copyright 2021 typicode

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ The component may include material which is licensed under other licenses / copy
listed below. Your use of this material within the component is also subject to the terms and
conditions of these licenses. The LICENSE file contains the text of all the licenses which apply
within this component..

Material from husky is:
Copyright (c) 2021 typicode
Licensed under the MIT License
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
title: Firebolt Core SDK
---

[![semantic-release: conventional](https://img.shields.io/badge/semantic--release-conventional-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)

# Firebolt JS SDK
For building Firebolt compliant apps.

Expand Down
Loading

0 comments on commit 5d25617

Please sign in to comment.