Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: updated flows #86

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/init-npm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: init-npm
description: 'Initialize the repo with npm and install all the dependencies'
inputs:
node-version:
description: 'Node.js version'
required: true
default: '20.x'
runs:
using: composite
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: npm
- name: Install TS Project dependencies
shell: bash
run: npm ci
- name: build
shell: bash
run: npm run build
11 changes: 5 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: publish

on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -11,11 +13,8 @@ jobs:
packages: write # allow GITHUB_TOKEN to publish packages
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run build
- name: Init nodejs
uses: ./.github/actions/init-npm
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
24 changes: 10 additions & 14 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
name: Run TS Project eslint
runs-on: ubuntu-latest

strategy:
matrix:
node: [20.x, 22.x]

steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v1
- name: Init nodejs
uses: ./.github/actions/init-npm
with:
node-version: 20.x
cache: npm

- name: Install TS Project dependencies
run: npm ci
node-version: ${{ matrix.node }}

- name: Run TS Project linters
uses: wearerequired/lint-action@v2
Expand All @@ -39,13 +39,9 @@ jobs:
steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install TS Project dependencies
run: npm ci
- name: Init nodejs
uses: ./.github/actions/init-npm

- name: Pack the package
run: npm pack
- name: get properties
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install TS Project dependencies
run: npm ci
- name: Init nodejs
uses: ./.github/actions/init-npm
- name: build docs
run: npm run typedoc
- name: build the package
Expand Down
Loading