2021-04-16 11:06:49 +00:00
name : Build release zip file
on :
workflow_dispatch :
inputs :
ref :
2022-01-24 21:54:08 +00:00
description : 'By default the zip file is generated from the branch the workflow runs from, but you can specify an explicit reference to use instead here (e.g. refs/tags/tag_name or refs/heads/release/x.x). The resulting file will be available as an artifact on the workflow run.'
2021-04-16 11:06:49 +00:00
required : false
default : ''
jobs :
build :
name : Build release zip file
2022-04-27 01:28:56 +00:00
runs-on : ubuntu-20.04
2021-04-16 11:06:49 +00:00
steps :
2022-04-27 13:40:37 +00:00
- name : Checkout code.
2022-04-21 18:29:53 +00:00
uses : actions/checkout@v3
2022-04-27 13:40:37 +00:00
2022-05-02 23:48:20 +00:00
- name : Get cached composer and pnpm directories
uses : actions/cache@v3
id : cache-deps
with :
path : |
~/.pnpm-store
plugins/woocommerce/packages
plugins/woocommerce/**/vendor
key : ${{ runner.os }}-npm-composer-${{ hashFiles('**/composer.lock', '**/pnpm-lock.yaml') }}
2022-04-27 13:40:37 +00:00
- name : Install PNPM
2022-05-02 17:08:52 +00:00
run : npm install -g pnpm@^6.24.2
2022-04-27 13:40:37 +00:00
2022-05-02 23:48:20 +00:00
- name : Setup PHP
uses : shivammathur/setup-php@v2
with :
php-version : '7.4'
2022-04-27 13:40:37 +00:00
- name : Build zip
2022-05-02 23:48:20 +00:00
working-directory : plugins/woocommerce
run : bash bin/build-zip.sh
2022-04-27 13:40:37 +00:00
2021-04-16 11:06:49 +00:00
- name : Upload the zip file as an artifact
2022-04-27 13:40:37 +00:00
uses : actions/upload-artifact@v3
2021-04-16 11:06:49 +00:00
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
name : woocommerce
2022-04-27 13:40:37 +00:00
path : plugins/woocommerce/woocommerce.zip
2021-04-16 11:06:49 +00:00
retention-days : 7