Workflow file for this run
This file contains hidden or 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
# Triggers when a release is published in the GitHub UI | |
name: Build and Upload Release Asset | |
on: | |
release: | |
types: [published] # Trigger when a release is published | |
jobs: | |
build-and-upload: | |
name: Build and Upload Asset | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
# Checkout the specific tag associated with the release | |
ref: ${{ github.event.release.tag_name }} | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Create plugin zip | |
run: npm run plugin-zip | |
- name: Create demo plugin zip | |
run: npm run plugin-zip -w wp-feature-api-agent | |
- name: Upload Main Plugin Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} # Get upload URL from the release event | |
asset_path: ./wp-feature-api.zip | |
asset_name: wp-feature-api.zip | |
asset_content_type: application/zip | |
- name: Upload Demo Plugin Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./demo/wp-feature-api-agent/wp-feature-api-agent.zip | |
asset_name: wp-feature-api-agent.zip | |
asset_content_type: application/zip |