name: Build release zip file on: workflow_dispatch: inputs: ref: 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.' required: false default: '' jobs: build: name: Build release zip file runs-on: ubuntu-20.04 steps: - name: Checkout code. uses: actions/checkout@v3 - 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-version-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/composer.lock', '**/pnpm-lock.yaml') }} - name: Install PNPM run: npm install -g pnpm@^6.24.2 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '7.4' - name: Build zip working-directory: plugins/woocommerce run: bash bin/build-zip.sh - name: Unzip the file (prevents double zip problem) run: unzip plugins/woocommerce/woocommerce.zip -d zipfile - name: Upload the zip file as an artifact uses: actions/upload-artifact@v3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: name: woocommerce path: zipfile retention-days: 7