Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Build Plugin zip, store as artifact on every PR #26746

Merged
merged 3 commits into from
Nov 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build Gutenberg Plugin Zip

on:
pull_request:
paths-ignore:
- '**.md'
push:
branches: [master]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is a different yaml array syntax, but I expected a single-item list like:

  branches:
    - master

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! FWIW, this was copy-pasted from the existing unit-test GH action, and I think that most of the other actions also have it like this, but we can change it here (and maybe file a PR to change it for the existing actions).

paths-ignore:
- '**.md'

jobs:
build:
name: Build Release Artifact
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
Comment on lines +33 to +36
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to use .nvmrc version. There are some good suggestions here: actions/setup-node#32

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Same as #26746 (comment) applies.)


- name: Build Gutenberg plugin ZIP file
run: ./bin/build-plugin-zip.sh
env:
NO_CHECKS: 'true'

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: gutenberg-plugin
path: ./gutenberg.zip