Skip to content

Commit 119b439

Browse files
authored
ci: port workflows from next to master branch (#5448)
1 parent e05e0be commit 119b439

5 files changed

Lines changed: 57 additions & 89 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
include:
47-
- language: javascript-typescript
48-
build-mode: none
47+
- language: javascript-typescript
48+
build-mode: none
4949
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
5050
# Use `c-cpp` to analyze code written in C, C++ or both
5151
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -55,42 +55,39 @@ jobs:
5555
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5656
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5757
steps:
58-
- name: Checkout repository
59-
uses: actions/checkout@v4
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
6060

61-
# Initializes the CodeQL tools for scanning.
62-
- name: Initialize CodeQL
63-
uses: github/codeql-action/init@v3
64-
with:
65-
languages: ${{ matrix.language }}
66-
build-mode: ${{ matrix.build-mode }}
67-
config: |
68-
paths-ignore:
69-
- 'dist/'
70-
# If you wish to specify custom queries, you can do so here or in a config file.
71-
# By default, queries listed here will override any specified in a config file.
72-
# Prefix the list here with "+" to use these queries and those in the config file.
61+
# Initializes the CodeQL tools for scanning.
62+
- name: Initialize CodeQL
63+
uses: github/codeql-action/init@v3
64+
with:
65+
languages: ${{ matrix.language }}
66+
build-mode: ${{ matrix.build-mode }}
67+
# If you wish to specify custom queries, you can do so here or in a config file.
68+
# By default, queries listed here will override any specified in a config file.
69+
# Prefix the list here with "+" to use these queries and those in the config file.
7370

74-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
75-
# queries: security-extended,security-and-quality
71+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
72+
# queries: security-extended,security-and-quality
7673

77-
# If the analyze step fails for one of the languages you are analyzing with
78-
# "We were unable to automatically build your code", modify the matrix above
79-
# to set the build mode to "manual" for that language. Then modify this step
80-
# to build your code.
81-
# ℹ️ Command-line programs to run using the OS shell.
82-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
83-
- if: matrix.build-mode == 'manual'
84-
shell: bash
85-
run: |
86-
echo 'If you are using a "manual" build mode for one or more of the' \
87-
'languages you are analyzing, replace this with the commands to build' \
88-
'your code, for example:'
89-
echo ' make bootstrap'
90-
echo ' make release'
91-
exit 1
74+
# If the analyze step fails for one of the languages you are analyzing with
75+
# "We were unable to automatically build your code", modify the matrix above
76+
# to set the build mode to "manual" for that language. Then modify this step
77+
# to build your code.
78+
# ℹ️ Command-line programs to run using the OS shell.
79+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
80+
- if: matrix.build-mode == 'manual'
81+
shell: bash
82+
run: |
83+
echo 'If you are using a "manual" build mode for one or more of the' \
84+
'languages you are analyzing, replace this with the commands to build' \
85+
'your code, for example:'
86+
echo ' make bootstrap'
87+
echo ' make release'
88+
exit 1
9289
93-
- name: Perform CodeQL Analysis
94-
uses: github/codeql-action/analyze@v3
95-
with:
96-
category: "/language:${{matrix.language}}"
90+
- name: Perform CodeQL Analysis
91+
uses: github/codeql-action/analyze@v3
92+
with:
93+
category: "/language:${{matrix.language}}"

.github/workflows/docker-build-push.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# inspired by https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
23
name: Build & Push SwaggerEditor@next Docker image
34

@@ -20,29 +21,18 @@ jobs:
2021
with:
2122
ref: next
2223

23-
- name: Download build artifact
24-
uses: actions/github-script@v7
24+
- name: Use Node.js 22
25+
uses: actions/setup-node@v4
2526
with:
26-
script: |
27-
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
28-
owner: context.repo.owner,
29-
repo: context.repo.repo,
30-
run_id: context.payload.workflow_run.id,
31-
});
32-
const matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
33-
return artifact.name == "build"
34-
})[0];
35-
const download = await github.rest.actions.downloadArtifact({
36-
owner: context.repo.owner,
37-
repo: context.repo.repo,
38-
artifact_id: matchArtifact.id,
39-
archive_format: 'zip',
40-
});
41-
const fs = require('fs');
42-
fs.writeFileSync('${{github.workspace}}/build.zip', Buffer.from(download.data));
43-
- run: |
44-
mkdir build
45-
unzip build.zip -d build
27+
node-version: 22
28+
cache: npm
29+
cache-dependency-path: package-lock.json
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Build App artifacts
35+
run: npm run build:app
4636

4737
- name: Determine released version
4838
uses: actions/github-script@v7

.github/workflows/nightly-build.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,12 @@ jobs:
1919
submodules: true
2020
ref: next
2121

22-
- name: Use Node.js 20
22+
- name: Use Node.js 22
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 20
26-
27-
- name: Cache npm cache files
28-
id: cache-npm-cache-files
29-
uses: actions/cache@v4
30-
with:
31-
path: ~/.npm
32-
key: npm-cache-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
33-
- name: Cache Cypress binary
34-
id: cache-cypress-binary
35-
uses: actions/cache@v4
36-
with:
37-
path: cypress/cache
38-
key: cypress-binary-${{ hashFiles('package-lock.json') }}
25+
node-version: 22
26+
cache: npm
27+
cache-dependency-path: package-lock.json
3928

4029
- name: Install dependencies
4130
run: npm ci

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24-
- name: Use Node.js 20
24+
- name: Use Node.js 20.3.0
2525
uses: actions/setup-node@v4
2626
with:
27-
node-version: 20
27+
node-version: 20.3.0
2828

2929
- name: Cache Node Modules and Cypress binary
3030
uses: actions/cache@v4

.github/workflows/release.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
submodules: true
1818
ref: next
1919

20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
2025
- name: Determine the next release version
2126
uses: cycjimmy/semantic-release-action@v4
2227
with:
@@ -35,11 +40,6 @@ jobs:
3540
script: |
3641
core.setFailed('Nothing to release')
3742
38-
- name: Setup Node.js
39-
uses: actions/setup-node@v4
40-
with:
41-
node-version: 20
42-
4343
- name: Install dependencies
4444
run: npm ci
4545

@@ -49,7 +49,6 @@ jobs:
4949
run: |
5050
npm run lint
5151
npm run test
52-
npm run build:app
5352
npm run cy:ci
5453
npm run build:bundle:esm
5554
npm run build:bundle:umd
@@ -79,13 +78,6 @@ jobs:
7978
echo ${{ steps.semantic.outputs.new_release_minor_version }}
8079
echo ${{ steps.semantic.outputs.new_release_patch_version }}
8180
82-
- name: Upload build artifacts
83-
uses: actions/upload-artifact@v4
84-
with:
85-
name: build
86-
path: ./build
87-
88-
8981
- name: Prepare released version for uploading
9082
shell: bash
9183
run: |

0 commit comments

Comments
 (0)