Skip to content

Commit

Permalink
Ci improvements (#3)
Browse files Browse the repository at this point in the history
* chore: update pnpm-lock.yaml

* chore: update dependencies

* ci: add workflow for ci

* ci: add publish workflow

* fix: remove unnecessary steps in CI workflow

* chore: add changesets
  • Loading branch information
antoniogiroz authored Mar 30, 2023
1 parent 1a2ba91 commit 833fc95
Show file tree
Hide file tree
Showing 6 changed files with 389 additions and 265 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-monkeys-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@antoniogiroz/eslint-config": major
---

Setup GitHub Actions for CI/CD
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

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

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

- name: Set up PNPM
uses: pnpm/action-setup@v2
with:
version: 7

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint
21 changes: 0 additions & 21 deletions .github/workflows/lint.yml

This file was deleted.

26 changes: 17 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
name: Publish

on:
workflow_run:
workflows: [CI]
types:
- completed
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Publish
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v3
- name: Pnpm

- name: Set up PNPM
uses: pnpm/action-setup@v2
with:
version: 7
- name: Node

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 16.x
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run lint
publish: pnpm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34 changes: 21 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"name": "@antoniogiroz/eslint-config",
"version": "1.0.0",
"packageManager": "pnpm@7.13.0",
"version": "0.1.0",
"packageManager": "pnpm@7.30.5",
"description": "Antonio Giroz's ESLint Config",
"keywords": [
"eslint-config"
],
"main": "index.js",
"files": [
"index.js",
"base.js",
"typescript.js",
"vue.js",
"react.js"
],
"scripts": {
"lint": "eslint . --cache",
"lint:fix": "eslint . --fix",
"prepare": "husky install"
"prepare": "husky install",
"changeset": "changeset"
},
"peerDependencies": {
"eslint": ">=8.0.0",
Expand All @@ -22,18 +30,18 @@
}
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.2",
"eslint-config-prettier": "^8.7.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jsonc": "^2.7.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-n": "^15.6.1",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
Expand All @@ -42,19 +50,19 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^46.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-vue": "^9.9.0",
"eslint-plugin-vue": "^9.10.0",
"eslint-plugin-yml": "^1.5.0",
"jsonc-eslint-parser": "^2.2.0",
"local-pkg": "^0.4.3",
"prettier": "^2.8.4",
"prettier": "^2.8.7",
"yaml-eslint-parser": "^1.2.0"
},
"devDependencies": {
"@changesets/cli": "^2.26.0",
"@commitlint/cli": "^17.4.4",
"@changesets/cli": "^2.26.1",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@types/node": "^18.15.3",
"eslint": "^8.36.0",
"@types/node": "^18.15.11",
"eslint": "^8.37.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.0",
"typescript": "^5.0.2"
Expand Down
Loading

0 comments on commit 833fc95

Please sign in to comment.