Skip to content

Commit

Permalink
ci: added checks.yml (#8)
Browse files Browse the repository at this point in the history
* ci: added checks.yml

* ci: added test scripts in package.json

* ci: remove npm run test

* ci: added lerna

* ci: added nx

* ci: version independent

* ci: added codeql.yml

* ci: added release.yml

* ci: added release-manual.yml

* ci: update release manual and lerna.json

* ci: remove release.yml
  • Loading branch information
Egor Didenko authored Apr 11, 2024
1 parent cd3ba5d commit 33d0b3a
Show file tree
Hide file tree
Showing 7 changed files with 9,022 additions and 1,130 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Checks"

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
working-directory: ./
run: npm ci
- name: Run build
run: npm run build
43 changes: 43 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "CodeQL"

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 8 * * 6"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
42 changes: 42 additions & 0 deletions .github/workflows/release-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Release and Publish Manual"

on: workflow_dispatch

jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Use Node.js 16"
uses: actions/setup-node@v4
with:
node-version: '16'

- name: "Install dependencies"
working-directory: ./
run: npm ci

- name: "Run build"
run: lerna run build

- name: "Version and publish 🚀"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [ ${{ github.base_ref }} = develop ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid alpha --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi
npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npx lerna publish from-git --yes
15 changes: 15 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent",
"command": {
"version": {
"createRelease": "github",
"conventionalCommits": true,
"allowBranch": [
"main",
"develop"
],
"message": "chore(release): publish"
}
}
}
25 changes: 25 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"targetDefaults": {
"dev": {
"cache": true,
"dependsOn": [
"^dev"
]
},
"build": {
"cache": true,
"dependsOn": [
"^build"
]
},
"preview": {
"dependsOn": []
},
"test": {
"cache": true,
"dependsOn": [
"^test"
]
}
}
}
Loading

0 comments on commit 33d0b3a

Please sign in to comment.