Skip to content

Commit

Permalink
ci: updated flows (#86)
Browse files Browse the repository at this point in the history
* ci: updated flows

* ci: removed node version
  • Loading branch information
CptSchnitz authored Dec 29, 2024
1 parent 31e0df4 commit acb52da
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 27 deletions.
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

0 comments on commit acb52da

Please sign in to comment.