Skip to content

Commit

Permalink
feat: repo init + github release (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 authored Jul 13, 2021
1 parent 2b04bb1 commit 35cae6c
Show file tree
Hide file tree
Showing 23 changed files with 11,416 additions and 84 deletions.
10 changes: 5 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ module.exports = {
env: {
node: true,
commonjs: true,
es2021: true
es2021: true,
},
parser: 'babel-eslint',
extends: ['prettier', 'standard'],
extends: ['standard', 'prettier'],
plugins: ['prettier'],
parserOptions: {
ecmaVersion: 12
}
}
ecmaVersion: 12,
},
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/ @ianaya89 @ndom91
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
I hereby confirm that I followed the code guidelines found at [engineering guidelines](https://www.notion.so/checkly/Engineering-Guidelines-a3a165a203a04dc1a112f0e26b2f2d3f)

## ⚙️ Affected Components
* [ ] Commands
* [ ] Modules
* [ ] Services
* [ ] SDK

<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### 📝 Notes for the Reviewer
<!-- Anything the reviewer should pay extra attention to. -->

### 🏗️ New Dependency Submission
<!-- Please explain here why we need the new dependency. -->

### 🎟 Affected Issue
<!--
If you write `"Fixes"` or `"Closes"` before the issue link like so:
```
Fixes #359
```
the connected issue will be automatically closed once the PR is merged and help with maintenance of the library 😊
-->
14 changes: 14 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sdk:
- sdk/**/*

commands:
- src/commands/**/*

modules:
- src/modules/**/*

services:
- src/services/**/*

core:
- src/**/*.js
25 changes: 25 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- priority
- bug
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
Hi there! It looks like this issue hasn't had any activity for a while.
It will be closed if no further activity occurs. If you think your issue
is still relevant, feel free to comment on it to keep it open.
Thanks!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
Hi there! It looks like this issue hasn't had any activity for a while.
To keep things tidy, I am going to close this issue for now.
If you think your issue is still relevant, just leave a comment
and I will reopen it.
Thanks!
13 changes: 13 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR Labeler

on:
- pull_request_target

jobs:
triage:
name: Triage
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
130 changes: 130 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: Release

on:
push:
branches:
- 'main'
- 'next'
pull_request:

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Init
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Dependencies
uses: bahmutov/npm-install@v1
- name: Build
run: npm run build
- name: Run tests
run: npm test
release-branch:
name: Publish branch
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name == 'push' }}
steps:
- name: Init
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Dependencies
uses: bahmutov/npm-install@v1
- name: Retrieve information from package.json
uses: myrotvorets/[email protected]
id: ver
- name: Publish to npm and GitHub
run: npx semantic-release@17
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Slack FAILURE alert
- name: Slack Failure Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_USERNAME: Checkly Github Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: mac
SLACK_ICON: https://github.com/checkly.png?size=48
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ':red_circle: Create Branch Release Failed'
SLACK_MESSAGE: ${{ steps.ver.outputs.packageName }}@${{ steps.ver.outputs.packageVersion }} by ${{ github.actor }}
SLACK_FOOTER: ''
# Slack SUCCESS alert
- name: Slack Success Notification
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_USERNAME: Checkly Github Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: mac
SLACK_ICON: https://github.com/checkly.png?size=48
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ':kebab_parrot: Created Branch Release Succeeded'
SLACK_MESSAGE: ${{ steps.ver.outputs.packageName }}@${{ steps.ver.outputs.packageVersion }} by ${{ github.actor }}
SLACK_FOOTER: ''
release-pr:
name: Publish PR
runs-on: ubuntu-latest
needs: test
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Init
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Dependencies
uses: bahmutov/npm-install@v1
- name: Retrieve information from package.json
uses: myrotvorets/[email protected]
id: ver
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Publish to npm
run: |
npm run version:pr
npm publish --tag canary
env:
CHECKLY_API_KEY: ${{ secrets.CHECKLY_API_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
# Slack FAILURE alert
- name: Slack Failure Notification
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_USERNAME: Checkly Github Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: mac
SLACK_ICON: https://github.com/checkly.png?size=48
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ':red_circle: Create PR Release Failed'
SLACK_MESSAGE: '`${{ steps.ver.outputs.packageName }}@${{ steps.ver.outputs.packageVersion }}-pr.${{ github.event.number }}.${{ steps.slug.outputs.sha8 }}` by ${{ github.actor }}'
SLACK_FOOTER: ''
# Slack SUCCESS alert
- name: Slack Success Notification
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_USERNAME: Checkly Github Bot
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: mac
SLACK_ICON: https://github.com/checkly.png?size=48
SLACK_COLOR: ${{ job.status }}
SLACK_TITLE: ':kebab_parrot: Created PR Release Succeeded'
SLACK_MESSAGE: '`${{ steps.ver.outputs.packageName }}@${{ steps.ver.outputs.packageVersion }}-pr.${{ github.event.number }}.${{ steps.slug.outputs.sha8 }}` by ${{ github.actor }}'
SLACK_FOOTER: ''
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
node_modules
.vscode
.checkly
.DS_Store
.DS_Store
oclif.manifest.json
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
# checkly-cli
<p>
<img height="128" src="https://www.checklyhq.com/images/footer-logo.svg" align="right" />
<h1>checkly-cli</h1>
</p>


[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/checkly-cli.svg)](https://npmjs.org/package/checkly-cli)
[![Downloads/week](https://img.shields.io/npm/dw/checkly-cli.svg)](https://npmjs.org/package/checkly-cli)
[![License](https://img.shields.io/npm/l/checkly-cli.svg)](https://github.com/ianaya89/checkly-cli/blob/master/package.json)

## 📚 Table of Contents

<!-- toc -->
* [checkly-cli](#checkly-cli)
* [Usage](#usage)
* [Commands](#commands)

<!-- tocstop -->

# Usage
## 🔧 Usage

<!-- usage -->
```sh-session
$ npm install -g @checkly/cli
$ checkly COMMAND
running command...
$ checkly (-v|--version|version)
@checkly/cli/0.0.1 darwin-x64 node-v14.15.1
@checkly/cli/0.0.1 linux-x64 node-v15.14.0
$ checkly --help [COMMAND]
USAGE
$ checkly COMMAND
...
```
<!-- usagestop -->

# Commands
## 🏗️ Commands

<!-- commands -->
* [`checkly checks ACTION [ID]`](#checkly-checks-action-id)
Expand Down Expand Up @@ -124,3 +128,11 @@ ARGUMENTS

_See code: [src/commands/login.js](https://github.com/checkly/checkly-cli/blob/v0.0.1/src/commands/login.js)_
<!-- commandsstop -->

## 🙏 Contributing

All contributions are welcome, please stick to the `eslint` and `prettier` settings.

## 📖 License

[MIT](https://opensource.org/licenses/MIT)
7 changes: 4 additions & 3 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node

require('../src').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
require('../src')
.run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
Loading

0 comments on commit 35cae6c

Please sign in to comment.