diff --git a/.ctrc.yml b/.ctrc.yml new file mode 100644 index 0000000..6e0bf9c --- /dev/null +++ b/.ctrc.yml @@ -0,0 +1,3 @@ +git: + provider: github + project: AdeAttwood/DiffCov diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d3e7f0a --- /dev/null +++ b/.github/dependabot.yml @@ -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' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..88f8f90 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/ct-commitlint.yml b/.github/workflows/ct-commitlint.yml new file mode 100644 index 0000000..f7d185b --- /dev/null +++ b/.github/workflows/ct-commitlint.yml @@ -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 diff --git a/.github/workflows/ct-release.yml b/.github/workflows/ct-release.yml new file mode 100644 index 0000000..7ca1471 --- /dev/null +++ b/.github/workflows/ct-release.yml @@ -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 }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..d8c1820 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -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 }}