Skip to content

Commit

Permalink
Merge pull request #23 from 10up/fix/15
Browse files Browse the repository at this point in the history
Add a workflow to build a release asset
  • Loading branch information
dkotter authored Oct 18, 2023
2 parents 929f626 + 310df67 commit 14d57d7
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 334 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build release zip

on:
workflow_dispatch:
workflow_call:
push:
branches:
- trunk

jobs:
build:
name: Build release zip
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Install Composer dependencies
run: composer install --no-dev -o

- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm

- name: Install Node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-optional

- name: Build plugin
run: npm run build

- name: Generate ZIP file
uses: 10up/action-wordpress-plugin-build-zip@stable
Loading

0 comments on commit 14d57d7

Please sign in to comment.