Skip to content

Commit 9114403

Browse files
committed
Updated CI and added Badges to README
1 parent 16e55e1 commit 9114403

File tree

5 files changed

+144
-9
lines changed

5 files changed

+144
-9
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ updates:
99
directory: "/" # Location of package manifests
1010
target-branch: "dev"
1111
schedule:
12-
interval: "monthly"
12+
interval: "weekly"
1313
- package-ecosystem: "github-actions"
1414
directory: "/"
1515
target-branch: "dev"

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# CI workflow to install, lint, build, and upload artifacts
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [ main, '**' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: 'npm'
22+
- name: Install dependencies
23+
run: npm ci
24+
- name: Lint
25+
run: npm run lint --if-present
26+
- name: Build
27+
run: npm run build
28+
- name: Upload dist artifact
29+
if: success()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: dist
33+
path: dist/

.github/workflows/codeql.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# GitHub CodeQL analysis workflow
2+
name: CodeQL
3+
4+
on:
5+
push:
6+
branches: [ main, '**' ]
7+
pull_request:
8+
branches: [ main ]
9+
schedule:
10+
- cron: '0 5 * * 1' # weekly Monday at 05:00 UTC
11+
12+
permissions:
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
analyze:
18+
name: Analyze
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
security-events: write
23+
actions: read
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
language: [ 'javascript' ]
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v3
35+
with:
36+
languages: ${{ matrix.language }}
37+
38+
- name: Autobuild
39+
uses: github/codeql-action/autobuild@v3
40+
41+
- name: Perform CodeQL Analysis
42+
uses: github/codeql-action/analyze@v3
43+
with:
44+
category: '/language:${{matrix.language}}'

.github/workflows/npm-publish.yml

Lines changed: 61 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,77 @@
11
# Derived from: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
22

3-
name: Node.js Package
3+
name: Publish Node.js Package
44

55
on:
66
release:
77
types: [published]
88

9+
permissions:
10+
contents: read
11+
packages: write
12+
913
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: 'npm' # Added caching
24+
- run: npm ci
25+
- run: npm run build
26+
- name: Upload build artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: build-output
30+
path: dist/
31+
32+
publish-gpr:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
packages: write
38+
steps:
39+
- uses: actions/checkout@v4
40+
- uses: actions/setup-node@v4
41+
with:
42+
node-version: 20
43+
cache: 'npm'
44+
registry-url: https://npm.pkg.github.com/
45+
- name: Download build artifacts
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: build-output
49+
path: dist/
50+
- run: npm ci
51+
- name: Configure GitHub Packages scope
52+
run: echo "@$(echo '${{ github.repository }}' | cut -d '/' -f 1):registry=https://npm.pkg.github.com" >> .npmrc
53+
- run: npm publish --access public
54+
env:
55+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
56+
1057
publish-npm:
58+
needs: build
1159
runs-on: ubuntu-latest
60+
permissions:
61+
contents: read
1262
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-node@v3
63+
- uses: actions/checkout@v4
64+
- uses: actions/setup-node@v4
1565
with:
16-
node-version: 19
66+
node-version: 20
67+
cache: 'npm'
1768
registry-url: https://registry.npmjs.org/
18-
- run: npm clean-install
19-
- run: npm run build
69+
- name: Download build artifacts
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: build-output
73+
path: dist/
74+
- run: npm ci
2075
- run: npm publish --access public
2176
env:
2277
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# com_mapping-service-input
22

3-
Mapping Component Overview:
3+
[![Build](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/ci.yml)
4+
[![CodeQL](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/codeql.yml/badge.svg?branch=main)](https://github.com/kit-data-manager/com_mapping-service-input/actions/workflows/codeql.yml)
5+
[![npm version](https://img.shields.io/npm/v/@kit-data-manager/mapping-service-input.svg)](https://www.npmjs.com/package/@kit-data-manager/mapping-service-input)
6+
[![GitHub Packages](https://img.shields.io/badge/GitHub%20Packages-published-2ea44f?logo=github)](https://github.com/kit-data-manager/com_mapping-service-input/pkgs/npm/mapping-service-input)
47

58
The Mapping component serves as a user-friendly interface to extract metadata from data generated by instruments and map it to metadata schema.Our mappings are designed to align with widely accepted community schemes, custom-tailored for various techniques.
69

@@ -38,7 +41,7 @@ For enabling the download functionality, include the following HTML code in your
3841
class="ui primary button"
3942
id="submit"
4043
onclick="
41-
var component = document.getElementById('input-component');
44+
const component = document.getElementById('input-component');
4245
component.executeMapping(true)"
4346
>
4447
Map document

0 commit comments

Comments
 (0)