Skip to content

Commit

Permalink
feat: added semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 authored and acaldas committed Jun 12, 2024
1 parent f5e30b9 commit 95bd92d
Show file tree
Hide file tree
Showing 4 changed files with 1,476 additions and 43 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches: [main, staging, develop]
workflow_dispatch:

env:
HUSKY: 0

jobs:
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
permissions:
contents: write
issues: write

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 20.x
- name: Install dependencies
uses: pnpm/action-setup@v3
with:
version: latest-8
run_install: true
package_json_file: api/
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm run release
35 changes: 35 additions & 0 deletions api/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"branches": [
"production",
{
"name": "main",
"prerelease": "alpha"
},
{
"name": "experimental",
"prerelease": "experimental"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
6 changes: 4 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "powerhouse-switchboard",
"name": "@powerhousedao/switchboard-api",
"version": "0.0.1",
"description": "Open-source API over database models made to be developer- and analyst-friendly.",
"author": "makerdao",
Expand All @@ -15,7 +15,8 @@
"watch": "vitest watch",
"build": "node --no-warnings=ExperimentalWarning ./esbuild.config.js",
"inspect": "NODE_ENV=production node --max-old-space-size=512 --inspect dist/index.js",
"test:load": "autocannon http://localhost:3000/d/test-load -m POST --header 'Content-Type: application/json' -i tests/autocannon/registerListener.json --renderStatusCodes"
"test:load": "autocannon http://localhost:3000/d/test-load -m POST --header 'Content-Type: application/json' -i tests/autocannon/registerListener.json --renderStatusCodes",
"release": "semantic-release"
},
"dependencies": {
"@apollo/server": "^4.10.3",
Expand Down Expand Up @@ -74,6 +75,7 @@
"eslint-config-airbnb-typescript": "^17.1.0",
"gql-query-builder": "^3.8.0",
"node-fetch": "^3.3.2",
"semantic-release": "^24.0.0",
"typescript": "^5.4.5",
"vitest-mock-extended": "^1.3.1"
},
Expand Down
Loading

0 comments on commit 95bd92d

Please sign in to comment.