Skip to content

Commit

Permalink
Merge pull request #390 from 10up/enhancement/367
Browse files Browse the repository at this point in the history
Added "Build release zip" Workflow.
  • Loading branch information
peterwilsoncc authored Jan 4, 2023
2 parents a2acc34 + 29b1b33 commit 77ec2e5
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build release zip

on:
workflow_dispatch:
release:
types: [published]

jobs:
build_zip:
name: New release
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: npm install and build
run: |
npm install
npm run build
npm run makepot
composer install --no-dev
npm run archive
- name: Upload the ZIP file as an artifact
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: release
retention-days: 5

- name: Upload release asset
if: ${{ github.event_name == 'release' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{github.workspace}}/${{ github.event.repository.name }}.zip
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip

0 comments on commit 77ec2e5

Please sign in to comment.