Skip to content

Commit f762bd6

Browse files
Updated the build pipelines
1 parent cf73f07 commit f762bd6

File tree

3 files changed

+57
-65
lines changed

3 files changed

+57
-65
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
# The branches below must be a subset of the branches above
88
branches: [main]
99
schedule:
10-
- cron: '0 17 * * 3'
10+
- cron: "0 17 * * 3"
1111

1212
jobs:
1313
analyze:
@@ -17,46 +17,21 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
# Override automatic language detection by changing the below list
21-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
22-
language: ['javascript']
23-
# Learn more...
24-
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
20+
language: ["javascript"]
2521

2622
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v2
29-
with:
30-
# We must fetch at least the immediate parents so that if this is
31-
# a pull request then we can checkout the head.
32-
fetch-depth: 2
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0
3327

34-
# If this run was triggered by a pull request event, then checkout
35-
# the head of the pull request instead of the merge commit.
36-
- run: git checkout HEAD^2
37-
if: ${{ github.event_name == 'pull_request' }}
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v2
30+
with:
31+
languages: ${{ matrix.language }}
3832

39-
# Initializes the CodeQL tools for scanning.
40-
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v1
42-
with:
43-
languages: ${{ matrix.language }}
33+
- name: Autobuild
34+
uses: github/codeql-action/autobuild@v2
4435

45-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
46-
# If this step fails, then you should remove it and run the build manually (see below)
47-
- name: Autobuild
48-
uses: github/codeql-action/autobuild@v1
49-
50-
# ℹ️ Command-line programs to run using the OS shell.
51-
# 📚 https://git.io/JvXDl
52-
53-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
54-
# and modify them (or add more) to build your code if your project
55-
# uses a compiled language
56-
57-
#- run: |
58-
# make bootstrap
59-
# make release
60-
61-
- name: Perform CodeQL Analysis
62-
uses: github/codeql-action/analyze@v1
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@v2

.github/workflows/node.js.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: CI
4+
name: Node.js CI
55

66
on:
77
push:
@@ -19,18 +19,30 @@ jobs:
1919
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2020

2121
steps:
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
22+
- name: Checkout repository
23+
uses: actions/checkout@v3
24+
25+
- name: Set up Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v3
2527
with:
2628
node-version: ${{ matrix.node-version }}
27-
- run: npm ci
28-
- run: npm run build --if-present
29-
- run: npm run lint
30-
- run: npm run coverage
31-
- run: npm run build:example
3229

33-
- name: Deploy
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Build project
34+
run: npm run build --if-present
35+
36+
- name: Lint code
37+
run: npm run lint
38+
39+
- name: Run tests and collect coverage
40+
run: npm run coverage
41+
42+
- name: Build example
43+
run: npm run build:example
44+
45+
- name: Deploy to GitHub Pages
3446
if: ${{ github.ref == 'refs/heads/main' }}
3547
uses: peaceiris/actions-gh-pages@v3
3648
with:

.github/workflows/npm-publish.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Node.js Package
1+
name: Publish to npm
2+
23
on:
34
release:
45
types: [published]
@@ -7,35 +8,39 @@ jobs:
78
build:
89
runs-on: ubuntu-latest
910
steps:
10-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3
1112
with:
12-
# "ref" specifies the branch to check out.
13-
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted
1413
ref: ${{ github.event.release.target_commitish }}
15-
- uses: actions/setup-node@v1
14+
15+
- uses: actions/setup-node@v3
1616
with:
1717
node-version: 20
1818
registry-url: https://registry.npmjs.org/
19+
1920
- run: npm ci
21+
2022
- run: npm test
23+
2124
- run: npm run build
25+
2226
- run: git config --global user.name "GitHub CD bot"
27+
2328
- run: git config --global user.email "james.hrisho@gmail.com"
24-
- run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
29+
30+
- run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
31+
2532
- run: git add . && git commit -m "[Release] ${{ github.event.release.tag_name }}"
33+
2634
- run: npm publish
2735
env:
28-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
2938
- name: Upload a Build Artifact
30-
uses: actions/upload-artifact@v2.2.2
39+
uses: actions/upload-artifact@v3
3140
with:
32-
# Artifact name
33-
name:
34-
react-ace.min.js
35-
# A file, directory or wildcard pattern that describes what to upload
36-
path:
37-
dist/react-ace.min.js
38-
# The desired behavior if no files are found using the provided path.
41+
name: react-ace.min.js
42+
path: dist/react-ace.min.js
43+
3944
- run: git push
4045
env:
41-
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)