Skip to content

Commit ef22f16

Browse files
Harmeet SinghHarmeet Singh
authored andcommitted
ci(ngbootstrap): add GitHub Actions for library
1 parent 600d040 commit ef22f16

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI (datagrid)
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
cache: 'npm'
19+
20+
- run: npm ci
21+
22+
# ---- choose ONE build command ----
23+
# Angular CLI:
24+
- run: npm run build datagrid
25+
if: ${{ hashFiles('angular.json') != '' }}
26+
27+
# Nx:
28+
- run: npx nx build datagrid
29+
if: ${{ hashFiles('nx.json') != '' }}
30+
31+
# Optional:
32+
- run: npm run lint --if-present
33+
- run: npm run test --if-present

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release (npm)
2+
3+
on:
4+
push:
5+
tags: [ 'v*.*.*' ]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
registry-url: 'https://registry.npmjs.org'
19+
cache: 'npm'
20+
- run: npm ci
21+
22+
# Angular CLI:
23+
- run: npm run build datagrid
24+
if: ${{ hashFiles('angular.json') != '' }}
25+
# Nx:
26+
- run: npx nx build datagrid
27+
if: ${{ hashFiles('nx.json') != '' }}
28+
29+
- name: Publish
30+
run: |
31+
cd dist/datagrid || cd dist/libs/datagrid
32+
npm publish --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)