Skip to content

Commit

Permalink
chore: setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AdeAttwood committed Oct 24, 2022
1 parent a03f915 commit 656ef25
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .ctrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
git:
provider: github
project: AdeAttwood/DiffCov
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:

- package-ecosystem: npm
versioning-strategy: increase
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: "all"
commit-message:
prefix: "chore:"
assignees:
- "AdeAttwood"

- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
commit-message:
prefix: 'chore:'
assignees:
- 'AdeAttwood'
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push: { branches: ["0.x"] }
pull_request: { branches: ["0.x"] }

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v2
with: { node-version: 18 }

- name: Install dependencies
run: yarn install

- name: Lint
run: yarn lint

- name: Type Check
run: yarn build

- name: Test
run: yarn test --coverage
18 changes: 18 additions & 0 deletions .github/workflows/ct-commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Conventional Tools Commitlint

on:
push: { branches: ["0.x"] }
pull_request: { branches: ["0.x"] }

jobs:
commits:
name: Commitlint
runs-on: ubuntu-latest
container: registry.k1.zportal.co.uk/practically-oss/conventional-tools:1.x
steps:
- name: Checkout
uses: actions/checkout@v3
with: {fetch-depth: 1000}

- name: Lint commits
run: conventional-tools commitlint -l1
29 changes: 29 additions & 0 deletions .github/workflows/ct-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Conventional Tools Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: false

jobs:
release:
name: Release
runs-on: ubuntu-latest
container: registry.k1.zportal.co.uk/practically-oss/conventional-tools:1.x
env:
CT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Release
run: conventional-tools release-semver ${{ github.event.inputs.version }}
27 changes: 27 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish Release

on:
workflow_run:
workflows: ["Conventional Tools Release"]
types: ["completed"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies and build
run: yarn install && yarn build

- name: Publish package on NPM
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 656ef25

Please sign in to comment.