Build release zip #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build release zip | |
on: | |
workflow_run: | |
workflows: [Static Analysis] | |
types: [completed] | |
jobs: | |
on-success: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore npm dependency cache | |
uses: ./.github/actions/restore-npm-cache | |
- name: Build scripts | |
run: npm run build | |
- name: Install PHP-Scoper | |
run: composer global require humbug/php-scoper | |
- name: Install WP CLI | |
run: | | |
composer global require wp-cli/wp-cli-bundle | |
composer global require wp-cli/dist-archive-command | |
- name: Add Composer bin to PATH | |
run: echo "$HOME/.composer/vendor/bin/" >> $GITHUB_PATH | |
- name: Install composer dependencies | |
run: composer run phpscoper | |
- name: Generate zip | |
run: wp dist-archive ./ ${{ github.event.repository.name }} | |
- name: Unzip the archive (prevents double zip problem) | |
run: unzip ${{ github.event.repository.name }}.zip -d zipfile | |
shell: bash | |
- name: Upload the archive as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ github.event.repository.name }} | |
path: zipfile | |
retention-days: 5 | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo 'The triggering workflow failed' |