Skip to content

Commit 084450c

Browse files
Merge pull request #707 from nextcloud/chore/rename-build
chore: rename `node` to `npm-build` workflow
2 parents d77ae16 + e7192dc commit 084450c

5 files changed

Lines changed: 130 additions & 98 deletions

File tree

workflow-templates/node.properties.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

workflow-templates/node.yml

Lines changed: 6 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -6,108 +6,27 @@
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
77
# SPDX-License-Identifier: MIT
88

9-
name: Node
9+
# TODO: Remove this after a grace period of 6 months to give everyone the chance to switch to the new workflow name
10+
# TODO: To be removed end of 2026.
11+
name: No-op please switch to npm-build.yml
1012

1113
on: pull_request
1214

1315
permissions:
14-
contents: read
16+
contents: none
1517

1618
concurrency:
1719
group: node-${{ github.head_ref || github.run_id }}
1820
cancel-in-progress: true
1921

2022
jobs:
21-
changes:
22-
runs-on: ubuntu-latest-low
23-
permissions:
24-
contents: read
25-
pull-requests: read
26-
27-
outputs:
28-
src: ${{ steps.changes.outputs.src}}
29-
30-
steps:
31-
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
32-
id: changes
33-
continue-on-error: true
34-
with:
35-
filters: |
36-
src:
37-
- '.github/workflows/**'
38-
- 'src/**'
39-
- 'appinfo/info.xml'
40-
- 'package.json'
41-
- 'package-lock.json'
42-
- 'tsconfig.json'
43-
- '**.js'
44-
- '**.ts'
45-
- '**.vue'
46-
47-
build:
48-
runs-on: ubuntu-latest
49-
50-
needs: changes
51-
if: needs.changes.outputs.src != 'false'
52-
53-
name: NPM build
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57-
with:
58-
persist-credentials: false
59-
60-
- name: Read package.json node and npm engines version
61-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
62-
id: versions
63-
with:
64-
fallbackNode: '^24'
65-
fallbackNpm: '^11.3'
66-
67-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
68-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
69-
with:
70-
node-version: ${{ steps.versions.outputs.nodeVersion }}
71-
72-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
73-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
74-
75-
- name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460
76-
run: |
77-
npm i -g npm-package-lock-add-resolved@1.1.4
78-
npm-package-lock-add-resolved
79-
git --no-pager diff --exit-code
80-
81-
- name: Install dependencies & build
82-
env:
83-
CYPRESS_INSTALL_BINARY: 0
84-
PUPPETEER_SKIP_DOWNLOAD: true
85-
run: |
86-
npm ci
87-
npm run build --if-present
88-
89-
- name: Check build changes
90-
run: |
91-
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
92-
93-
- name: Show changes on failure
94-
if: failure()
95-
run: |
96-
git status
97-
git --no-pager diff
98-
exit 1 # make it red to grab attention
99-
10023
summary:
101-
permissions:
102-
contents: none
10324
runs-on: ubuntu-latest-low
104-
needs: [changes, build]
105-
10625
if: always()
10726

10827
# This is the summary, we just avoid to rename it so that branch protection rules still match
10928
name: node
11029

11130
steps:
112-
- name: Summary status
113-
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi
31+
- name: No-op please switch to npm-build.yml
32+
run: echo "The workflow has been renamed, please switch to npm-build.yml from organization templates"; exit 1;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Frontend build workflow",
3+
"description": "Nextcloud workflow template for check frontend builds.",
4+
"iconName": "npm-build",
5+
"categories": [
6+
"JavaScript"
7+
],
8+
"filePatterns": [
9+
"^package.json$"
10+
]
11+
}

workflow-templates/npm-build.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Build Javascript
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: node-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
changes:
22+
runs-on: ubuntu-latest-low
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- '**.js'
44+
- '**.ts'
45+
- '**.vue'
46+
47+
build:
48+
runs-on: ubuntu-latest
49+
50+
needs: changes
51+
if: needs.changes.outputs.src != 'false'
52+
53+
name: NPM build
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
with:
58+
persist-credentials: false
59+
60+
- name: Read package.json node and npm engines version
61+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
62+
id: versions
63+
with:
64+
fallbackNode: '^24'
65+
fallbackNpm: '^11.3'
66+
67+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
68+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
69+
with:
70+
node-version: ${{ steps.versions.outputs.nodeVersion }}
71+
72+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
73+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
74+
75+
- name: Validate package-lock.json # See https://github.com/npm/cli/issues/4460
76+
run: |
77+
npm i -g npm-package-lock-add-resolved@1.1.4
78+
npm-package-lock-add-resolved
79+
git --no-pager diff --exit-code
80+
81+
- name: Install dependencies & build
82+
env:
83+
CYPRESS_INSTALL_BINARY: 0
84+
PUPPETEER_SKIP_DOWNLOAD: true
85+
run: |
86+
npm ci
87+
npm run build --if-present
88+
89+
- name: Check build changes
90+
run: |
91+
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
92+
93+
- name: Show changes on failure
94+
if: failure()
95+
run: |
96+
git status
97+
git --no-pager diff
98+
exit 1 # make it red to grab attention
99+
100+
summary:
101+
permissions:
102+
contents: none
103+
runs-on: ubuntu-latest-low
104+
needs: [changes, build]
105+
106+
if: always()
107+
108+
# This is the summary, we just avoid to rename it so that branch protection rules still match
109+
name: node
110+
111+
steps:
112+
- name: Summary status
113+
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)