Skip to content

Commit 97b0eff

Browse files
authored
Merge pull request #1086 from 10up/update/workflows
Cleanup / Modify / Add GitHub Action Workflows
2 parents 5ba3501 + 86ae450 commit 97b0eff

28 files changed

Lines changed: 1155 additions & 676 deletions

.github/dependabot.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
commit-message:
9+
prefix: 'chore(ci)'
10+
labels:
11+
- dependencies
12+
groups:
13+
github-actions-updates:
14+
patterns: ['*']
15+
cooldown:
16+
default-days: 7
17+
18+
- package-ecosystem: composer
19+
directory: '/'
20+
schedule:
21+
interval: weekly
22+
open-pull-requests-limit: 10
23+
cooldown:
24+
semver-major-days: 30
25+
semver-minor-days: 7
26+
semver-patch-days: 7
27+
versioning-strategy: increase
28+
commit-message:
29+
prefix: 'fix'
30+
include: 'scope'
31+
labels:
32+
- dependencies
33+
groups:
34+
composer-dev-minor-patch:
35+
dependency-type: 'development'
36+
update-types: [minor, patch]
37+
# We don't bundle minor or major production assets, so they're tested individually.
38+
composer-patch:
39+
dependency-type: 'production'
40+
update-types: [patch]
41+
42+
- package-ecosystem: npm
43+
directory: '/'
44+
schedule:
45+
interval: weekly
46+
open-pull-requests-limit: 10
47+
cooldown:
48+
semver-major-days: 30
49+
semver-minor-days: 7
50+
semver-patch-days: 7
51+
versioning-strategy: increase
52+
commit-message:
53+
prefix: 'fix'
54+
include: 'scope'
55+
labels:
56+
- dependencies
57+
groups:
58+
npm-dev-minor-patch:
59+
dependency-type: 'development'
60+
update-types: [minor, patch]
61+
npm-prod-minor-patch:
62+
dependency-type: 'production'
63+
update-types: [minor, patch]

.github/workflows/build-docs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ on:
55
branches:
66
- trunk
77

8+
# Disable permissions for all available scopes by default.
9+
# Any needed permissions should be configured at the job level.
10+
permissions: {}
11+
812
jobs:
9-
release:
10-
name: Push (merge) to trunk
13+
build-docs:
14+
name: Build docs
1115
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
1218

1319
steps:
1420
- name: Checkout
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build Preview Zip
2+
3+
on:
4+
pull_request:
5+
types: [ 'opened', 'synchronize', 'reopened', 'edited' ]
6+
7+
# Cancels all previous workflow runs for pull requests that have not completed.
8+
concurrency:
9+
# The concurrency group contains the workflow name and the branch name for pull requests
10+
# or the commit hash for any other events.
11+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
12+
cancel-in-progress: true
13+
14+
# Disable permissions for all available scopes by default.
15+
# Any needed permissions should be configured at the job level.
16+
permissions: {}
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
outputs:
24+
job_status: ${{ job.status }}
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
31+
persist-credentials: false
32+
33+
- name: Set up PHP
34+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1
35+
with:
36+
php-version: '7.4'
37+
coverage: none
38+
39+
- name: Use desired version of Node.js
40+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
41+
with:
42+
node-version-file: '.nvmrc'
43+
check-latest: true
44+
45+
- name: Install NPM dependencies
46+
run: npm ci
47+
48+
- name: Install Composer dependencies
49+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4.0.0
50+
with:
51+
composer-options: '--no-dev -o'
52+
53+
- name: Build plugin
54+
run: |
55+
npm run build
56+
npm run makepot
57+
npm run archive
58+
59+
- name: Upload artifact
60+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
61+
with:
62+
name: classifai-zip-pr${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}
63+
path: classifai.zip
64+
if-no-files-found: error

.github/workflows/build-release-zip.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
workflow_dispatch:
55
workflow_call:
66

7+
# Disable permissions for all available scopes by default.
8+
# Any needed permissions should be configured at the job level.
9+
permissions: {}
10+
711
jobs:
812
build_zip:
913
name: Build release zip
1014
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
1117

1218
steps:
1319
- name: Checkout code

.github/workflows/close-stale-issues.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ on:
88
# Schedule for every day at 1:30am UTC
99
- cron: '30 1 * * *'
1010

11-
permissions:
12-
issues: write
11+
# Disable permissions for all available scopes by default.
12+
# Any needed permissions should be configured at the job level.
13+
permissions: {}
1314

1415
jobs:
1516
stale:
1617
runs-on: ubuntu-latest
18+
permissions:
19+
issues: write
20+
1721
steps:
1822
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
1923
with:

.github/workflows/codeql-analysis.yml

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

.github/workflows/cypress.yml

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

.github/workflows/dependency-review.yml

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

0 commit comments

Comments
 (0)