Skip to content

Commit

Permalink
ci(DEV-1061): Add package deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-belonio committed Jul 9, 2024
1 parent 80bca93 commit adf7f8b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 33 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/cd.release.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
name: Release
name: On push
on:
push:
branches:
- main
- master

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: yarn install --frozen-lockfile
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Code Coverage
run: yarn coverage
on_push:
permissions:
contents: write
name: On Push
uses: belonio/ci-workflows/.github/workflows/angular_package_workflow.yml@master
secrets: inherit
with:
distPath: ./fake-dist
nodeVersion: 18

30 changes: 30 additions & 0 deletions .releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = {
branches: ['master'],
plugins: [
[
'@semantic-release/commit-analyzer',
{
preset: 'angular',
releaseRules: [
{type: 'docs', scope: 'README', release: 'patch'},
{type: 'refactor', release: 'patch'},
{type: 'style', release: 'patch'},
],
parserOpts: {
noteKeywords: ['BREAKING CHANGE', 'BREAKING CHANGES'],
},
},
],
'@semantic-release/release-notes-generator',
'@semantic-release/github',
['@semantic-release/npm'],
[
'@semantic-release/git',
{
assets: ['package.json'],
message:
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
],
};
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"name": "serverless-pipes",
"name": "@belonio/serverless-pipes",
"version": "0.0.0-development",
"description": "Serverless Framework plugin called as \"pipes\", used to create EventBridge Pipes by providing the required event sources, targets and other parameters as needed.",
"scripts": {
"clean": "rm -rf ./lib/",
"build": "tsc -p ./tsconfig.cjs.json",
"build:library": "npm run build",
"watch": "tsc -p ./tsconfig.cjs.json --watch",
"cm": "cz",
"coverage": "codecov",
"lint": "eslint ./src/ --fix",
"prepare": "husky install",
"deploy-library": "npm run semantic-release",
"semantic-release": "semantic-release",
"type-check": "tsc --noEmit",
"test-prepare":"cp -f 'src/index.ts' 'src/index-copy.ts' && sed -i 's/module.exports = ServerlessPipes;//g' 'src/index-copy.ts' && sed -i 's/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index\";/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index-copy\";/g' 'tests/pipes.test.ts'",
"test-prepare": "cp -f 'src/index.ts' 'src/index-copy.ts' && sed -i 's/module.exports = ServerlessPipes;//g' 'src/index-copy.ts' && sed -i 's/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index\";/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index-copy\";/g' 'tests/pipes.test.ts'",
"test-temp": "yarn test-prepare && TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts' && yarn test-cleanup",
"test":"TS_NODE_PROJECT='./tsconfig.base.json' mocha -r ts-node/register 'tests/**/*.ts'",
"test-cleanup":"sed -i 's/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index-copy\";/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index\";/g' 'tests/pipes.test.ts' && rm -f 'src/index-copy.ts'"
"test": "TS_NODE_PROJECT='./tsconfig.base.json' mocha -r ts-node/register 'tests/**/*.ts'",
"test-cleanup": "sed -i 's/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index-copy\";/import { ServerlessPipes, ServerlessPluginOptions } from \"..\\/src\\/index\";/g' 'tests/pipes.test.ts' && rm -f 'src/index-copy.ts'"
},
"main": "./lib/index.js",
"types": "./lib/types/index.d.ts",
Expand All @@ -24,7 +26,7 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/distinction-dev/serverless-pipes.git"
"url": "git+https://github.com/belonio/serverless-pipes.git"
},
"license": "MIT",
"author": {
Expand Down Expand Up @@ -84,4 +86,4 @@
"ajv": "^8.12.0",
"serverless-schema": "^1.33.0"
}
}
}

0 comments on commit adf7f8b

Please sign in to comment.