Skip to content

Commit

Permalink
ci: updates to the GitHub Actions workflows for continuous integratio…
Browse files Browse the repository at this point in the history
…n (CI) and release processes. (#15)

* ci: streamline CI workflow by removing unnecessary steps and improving clarity

* ci: enhance release workflow by implementing a matrix strategy for Node.js version
  • Loading branch information
supitsdu authored Dec 30, 2024
1 parent c76f088 commit 9609445
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 91 deletions.
101 changes: 44 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,44 @@
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
quality:
name: Quality & Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [23.x]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Setup Biome.js
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Display Node.js version
run: node -v

- name: Install dependencies
run: npm ci

- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Run linting
run: npm run lint

- name: Run docs formatting
run: npm run format

- name: Run tests
run: npm test

- name: Build the package
run: npm run build
name: CI

on:
push:
branches:
- main
pull_request:

jobs:
quality:
name: Quality & Build
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [23.x]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Display Node.js version
run: node -v

- name: Install dependencies
run: npm ci

- name: Run linting
run: npm run lint

- name: Run docs formatting
run: npm run format

- name: Run tests
run: npm test

- name: Build the package
run: npm run build
72 changes: 38 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
name: Release

on:
release:
types: [published]

jobs:
publish:
name: NPM Publish
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Build the project
run: npm run build --if-present

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Release

on:
release:
types: [published]

jobs:
publish:
name: NPM Publish
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [23.x]

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Build the project
run: npm run build --if-present

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 9609445

Please sign in to comment.