mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +01:00
Build/Test Tools: Store WordPress.zip for every GitHub Pull Request as a GitHub artifact.
Storing build files enables reusing them in WordPress Playground and ultimately implementing a Pull Request. Props desrosj, bernhard-reiter See #59416. git-svn-id: https://develop.svn.wordpress.org/trunk@56958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eb637362c7
commit
8077c0723f
67
.github/workflows/build.yml
vendored
Normal file
67
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
name: Build WordPress
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
# Cancels all previous workflow runs for pull requests that have not completed.
|
||||
concurrency:
|
||||
# The concurrency group contains the workflow name and the branch name for pull requests
|
||||
# or the commit hash for any other events.
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Disable permissions for all available scopes by default.
|
||||
# Any needed permissions should be configured at the job level.
|
||||
permissions: {}
|
||||
|
||||
# Exposes WordPress builds as a GitHub artifact to enable
|
||||
# previewing Pull Requests inside WordPress Playground.
|
||||
#
|
||||
# @see https://github.com/WordPress/wordpress-playground/pull/700
|
||||
# @see https://github.com/WordPress/wordpress-develop/pull/5481
|
||||
jobs:
|
||||
build-wordpress:
|
||||
name: Upload WordPress build as an artifact
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 20
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
|
||||
with:
|
||||
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: npm
|
||||
|
||||
- name: Log debug information
|
||||
run: |
|
||||
npm --version
|
||||
node --version
|
||||
curl --version
|
||||
git --version
|
||||
svn --version
|
||||
|
||||
- name: Install npm Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build WordPress
|
||||
run: npm run build
|
||||
|
||||
- name: Zip WordPress build
|
||||
run: cd build && zip -r wordpress.zip .
|
||||
|
||||
- name: Upload the build directory as GitHub artifact
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
if: always()
|
||||
with:
|
||||
name: wordpress-build-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
|
||||
path: build/wordpress.zip
|
||||
if-no-files-found: error
|
Loading…
x
Reference in New Issue
Block a user