Skip to content

Commit bc04277

Browse files
authored
Merge pull request #1282 from nextcloud-libraries/chore/update-node-version
chore: update node version to all supported ones and add `devEngines`
2 parents 6594346 + e38a224 commit bc04277

11 files changed

Lines changed: 69 additions & 239 deletions

.github/workflows/block-unconventional-commits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors

.github/workflows/dependabot-approve-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
@@ -9,7 +9,7 @@
99
name: Dependabot
1010

1111
on:
12-
pull_request:
12+
pull_request_target: # zizmor: ignore[dangerous-triggers]
1313
branches:
1414
- main
1515
- master

.github/workflows/documentation.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
@@ -14,40 +14,23 @@ on:
1414
types: [published]
1515

1616
permissions:
17-
contents: read
17+
contents: write
1818

1919
jobs:
2020
build-and-deploy:
2121
runs-on: ubuntu-latest
2222

2323
name: Build and deploy
2424
steps:
25-
- name: Check actor permission level
26-
# Only allow admin to deploy on release
27-
if: github.event.release
28-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v2
29-
with:
30-
require: write
31-
3225
- name: Checkout
3326
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3427
with:
3528
persist-credentials: false
3629

37-
- name: Read package.json node and npm engines version
38-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
39-
id: versions
30+
- name: Set up node
31+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4032
with:
41-
fallbackNode: '^20'
42-
fallbackNpm: '^10'
43-
44-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
45-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
46-
with:
47-
node-version: ${{ steps.versions.outputs.nodeVersion }}
48-
49-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
50-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
33+
node-version-file: 'package.json'
5134

5235
- name: Install dependencies & build
5336
env:

.github/workflows/fixup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors

.github/workflows/lint-eslint.yml

Lines changed: 5 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
@@ -18,62 +18,21 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
changes:
22-
runs-on: ubuntu-latest
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@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
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-
- '.eslintrc.*'
44-
- '.eslintignore'
45-
- '**.js'
46-
- '**.ts'
47-
- '**.vue'
48-
4921
lint:
5022
runs-on: ubuntu-latest
5123

52-
needs: changes
53-
if: needs.changes.outputs.src != 'false'
54-
55-
name: NPM lint
24+
name: eslint
5625

5726
steps:
5827
- name: Checkout
5928
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6029
with:
6130
persist-credentials: false
6231

63-
- name: Read package.json node and npm engines version
64-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
65-
id: versions
66-
with:
67-
fallbackNode: '^20'
68-
fallbackNpm: '^10'
69-
70-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
32+
- name: Set up node
33+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7234
with:
73-
node-version: ${{ steps.versions.outputs.nodeVersion }}
74-
75-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
76-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
35+
node-version-file: 'package.json'
7736

7837
- name: Install dependencies
7938
env:
@@ -83,18 +42,3 @@ jobs:
8342

8443
- name: Lint
8544
run: npm run lint
86-
87-
summary:
88-
permissions:
89-
contents: none
90-
runs-on: ubuntu-latest
91-
needs: [changes, lint]
92-
93-
if: always()
94-
95-
# This is the summary, we just avoid to rename it so that branch protection rules still match
96-
name: eslint
97-
98-
steps:
99-
- name: Summary status
100-
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/node-test.yml

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
@@ -24,60 +24,20 @@ concurrency:
2424
cancel-in-progress: true
2525

2626
jobs:
27-
changes:
28-
runs-on: ubuntu-latest
29-
permissions:
30-
contents: read
31-
pull-requests: read
32-
33-
outputs:
34-
src: ${{ steps.changes.outputs.src}}
35-
36-
steps:
37-
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
38-
id: changes
39-
continue-on-error: true
40-
with:
41-
filters: |
42-
src:
43-
- '.github/workflows/**'
44-
- '__tests__/**'
45-
- '__mocks__/**'
46-
- 'src/**'
47-
- 'appinfo/info.xml'
48-
- 'package.json'
49-
- 'package-lock.json'
50-
- 'tsconfig.json'
51-
- '**.js'
52-
- '**.ts'
53-
- '**.vue'
54-
5527
test:
5628
runs-on: ubuntu-latest
57-
58-
needs: changes
59-
if: needs.changes.outputs.src != 'false'
29+
name: node-tests
6030

6131
steps:
6232
- name: Checkout
6333
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6434
with:
6535
persist-credentials: false
6636

67-
- name: Read package.json node and npm engines version
68-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
69-
id: versions
70-
with:
71-
fallbackNode: '^20'
72-
fallbackNpm: '^10'
73-
74-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
75-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
37+
- name: Set up node
38+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7639
with:
77-
node-version: ${{ steps.versions.outputs.nodeVersion }}
78-
79-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
80-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
40+
node-version-file: 'package.json'
8141

8242
- name: Install dependencies & build
8343
env:
@@ -93,20 +53,6 @@ jobs:
9353
run: npm run test:coverage --if-present
9454

9555
- name: Collect coverage
96-
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
56+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
9757
with:
9858
files: ./coverage/lcov.info
99-
100-
summary:
101-
permissions:
102-
contents: none
103-
runs-on: ubuntu-latest
104-
needs: [changes, test]
105-
106-
if: always()
107-
108-
name: test-summary
109-
110-
steps:
111-
- name: Summary status
112-
run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi

.github/workflows/node.yml

Lines changed: 5 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
@@ -18,59 +18,20 @@ concurrency:
1818
cancel-in-progress: true
1919

2020
jobs:
21-
changes:
22-
runs-on: ubuntu-latest
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@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
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-
4721
build:
4822
runs-on: ubuntu-latest
23+
name: node-build
4924

50-
needs: changes
51-
if: needs.changes.outputs.src != 'false'
52-
53-
name: NPM build
5425
steps:
5526
- name: Checkout
5627
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5728
with:
5829
persist-credentials: false
5930

60-
- name: Read package.json node and npm engines version
61-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
62-
id: versions
31+
- name: Set up node
32+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6333
with:
64-
fallbackNode: '^20'
65-
fallbackNpm: '^10'
66-
67-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
68-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.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 }}'
34+
node-version-file: 'package.json'
7435

7536
- name: Install dependencies & build
7637
env:
@@ -79,29 +40,3 @@ jobs:
7940
run: |
8041
npm ci
8142
npm run build --if-present
82-
83-
- name: Check webpack build changes
84-
run: |
85-
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
86-
87-
- name: Show changes on failure
88-
if: failure()
89-
run: |
90-
git status
91-
git --no-pager diff
92-
exit 1 # make it red to grab attention
93-
94-
summary:
95-
permissions:
96-
contents: none
97-
runs-on: ubuntu-latest
98-
needs: [changes, build]
99-
100-
if: always()
101-
102-
# This is the summary, we just avoid to rename it so that branch protection rules still match
103-
name: node
104-
105-
steps:
106-
- name: Summary status
107-
run: if ${{ needs.changes.outputs.src != 'false' && needs.build.result != 'success' }}; then exit 1; fi

0 commit comments

Comments
 (0)