-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: updates to the GitHub Actions workflows for continuous integratio…
…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
Showing
2 changed files
with
82 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |