Skip to content

Commit

Permalink
Git actions, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Kowalski committed Aug 2, 2023
1 parent a8bb48f commit 1ccd598
Show file tree
Hide file tree
Showing 10 changed files with 466 additions and 122 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ module.exports = {
ecmaVersion: 12,
sourceType: "module",
},
plugins: ["@typescript-eslint", "import"],
plugins: ["@typescript-eslint", "import", "prettier"],
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:import/warnings",
"prettier",
],
ignorePatterns: ["dist/**/*"],
rules: {
"prettier/prettier": ["error"],
"no-console": "warn",
"object-shorthand": ["error", "always"],
"no-extra-boolean-cast": "error",
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check code

on: [pull_request, push]

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

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: yarn --non-interactive --frozen-lockfile --ignore-scripts

- name: lint:check
run: yarn lint:check

- name: types:check
run: yarn types:check

- name: format:check
run: yarn format:check

- name: test:check
run: yarn test:check

- name: build
run: yarn build
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish new version

on:
workflow_dispatch:
inputs:
version:
description: "Choose version to bump"
required: true
default: "patch"
type: choice
options:
- "patch"
- "minor"
- "major"

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

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"

- name: Config git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config --global push.followTags true
- name: Install dependencies
run: yarn --non-interactive --frozen-lockfile --ignore-scripts

- name: Build lib
run: yarn build

- name: Publish new version
run: |
npm version ${{ github.event.inputs.version }}
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push to main
run: git push
3 changes: 1 addition & 2 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"tabWidth": 4,
"endOfLine": "auto"
"tabWidth": 4
}
Loading

0 comments on commit 1ccd598

Please sign in to comment.