Skip to content

feat: add ci-cd integration and semantic release #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: pipeline

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install 🔧
run: npm ci

- name: Build 🏗️
run: npm run build

- name: Release 🚀
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run semantic-release
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit $1

4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run test
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"trailingComma": "none",
"endOfLine": "auto"
"endOfLine": "auto",
"singleQuote": true
}
21 changes: 8 additions & 13 deletions __tests__/cli-integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
import { filesystem, system } from 'gluegun';
import { PackageJSON } from 'gluegun/build/types/toolbox/meta-types';

const src = filesystem.path(__dirname, '..')
const src = filesystem.path(__dirname, '..');

const cli = async (cmd) =>
system.run('node ' + filesystem.path(src, 'bin', 'ngx-devs-cli') + ` ${cmd}`)
system.run('node ' + filesystem.path(src, 'bin', 'ngx-devs-cli') + ` ${cmd}`);

describe('[Commands: version]', () => {
test('should output package.json version', async () => {
const packageJson: PackageJSON = filesystem.read(
`${src}/package.json`,
'json'
)

const expectedVersion = packageJson.version
const output = await cli('--version')

expect(output).toContain(expectedVersion)
})
})
const packageJson: PackageJSON = require('../package.json');
const version = packageJson?.version;
const output = await cli('-v');
expect(output).toContain(version);
});
});
89 changes: 89 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
module.exports = {
disableEmoji: false,
format: '{emoji} {type}{scope}: {subject}',
list: [
'build',
'test',
'feat',
'fix',
'chore',
'docs',
'refactor',
'style',
'ci',
'perf'
],
maxMessageLength: 64,
minMessageLength: 3,
questions: [
'type',
'scope',
'subject',
'body',
'breaking',
'issues',
'lerna'
],
scopes: [],
types: {
chore: {
description:
'Updating grunt tasks etc; no production code change "grunt task" means nothing that an external user would see.',
emoji: '🚧',
value: 'chore'
},
build: {
description:
'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
emoji: '🏗️',
value: 'build'
},
ci: {
description:
'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
emoji: '🔧',
value: 'ci'
},
docs: {
description: 'Documentation only changes',
emoji: '✏️',
value: 'docs'
},
feat: {
description: 'A new feature',
emoji: '✨',
value: 'feat'
},
fix: {
description: 'A bug fix',
emoji: '🐛',
value: 'fix'
},
perf: {
description: 'A code change that improves performance',
emoji: '🚀',
value: 'perf'
},
refactor: {
description: 'A code change that neither fixes a bug or adds a feature',
emoji: '📦',
value: 'refactor'
},
release: {
description: 'Create a release commit',
emoji: '🏹',
value: 'release'
},
style: {
description:
'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
emoji: '💄',
value: 'style'
},
test: {
description: 'Adding missing tests or correcting existing tests',
emoji: '🧪',
value: 'test'
}
}
};
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['gitmoji'] };
1 change: 0 additions & 1 deletion delpe/delpe.page.html

This file was deleted.

Empty file removed delpe/delpe.page.scss
Empty file.
12 changes: 0 additions & 12 deletions delpe/delpe.page.ts

This file was deleted.

Loading