Skip to content

Commit 9ee457f

Browse files
authored
Create node.js.yml
1 parent a8a0728 commit 9ee457f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/node.js.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically provided token with repo scope
13+
TAG: ${{ github.ref_name }} # The name of the pushed tag (e.g., v1.0.0)
14+
jobs:
15+
build:
16+
name: Create Release
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
node-version: [22.x]
21+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: 'npm'
29+
- name: Install Node Packages
30+
run: npm install
31+
- name: Fix imports in src (replace .ts with .js)
32+
run: |
33+
set -euo pipefail
34+
find src -type f -name "*.js" -exec sed -i "s/require(\(.*\)index\.ts/require(\1index/g" {} +
35+
- name: Build Typescript
36+
run: npx tsc
37+
- name: Copy Source to Dist folder
38+
run: cp src/ dist/ -r
39+
- name: remove config folder from dist
40+
run: rm dist/config/ -r
41+
- name: Upload build artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: build-output
45+
path: |
46+
dist/**
47+
package.json
48+
package-lock.json
49+

0 commit comments

Comments
 (0)