Beta-RC-3 #2
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
| name: Build WordPress Plugin | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - run: npm install | |
| - name: Set release version | |
| if: github.event_name == 'release' | |
| run: echo "PLUGIN_VERSION=${{ github.event.release.tag_name }}" | sed 's/=v/=/' >> $GITHUB_ENV | |
| - run: npm run build:wordpress-plugin | |
| - name: Find built files | |
| id: find-files | |
| run: | | |
| ZIP_PATH=$(ls dist/oiaa-meetings-wordpress-plugin-*.zip) | |
| echo "zip_path=$ZIP_PATH" >> $GITHUB_OUTPUT | |
| echo "zip_name=$(basename $ZIP_PATH)" >> $GITHUB_OUTPUT | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.find-files.outputs.zip_name }} | |
| path: ${{ steps.find-files.outputs.zip_path }} | |
| - name: Upload release assets | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ${{ steps.find-files.outputs.zip_path }} | |
| - name: Purge jsDelivr cache | |
| if: github.event_name == 'release' | |
| uses: egad13/purge-jsdelivr-cache@v1 | |
| with: | |
| url: | | |
| https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/oiaa-meetings.js | |
| https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/oiaa-meetings.css | |
| https://cdn.jsdelivr.net/gh/${{ github.repository }}@latest/dist/wordpress-overrides.css |