Zip and Attach to Release #3
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: Zip and Attach to Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Trigger on version tags like v1.0.0 | |
| jobs: | |
| build-zip: | |
| name: Create and Upload Plugin ZIP | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the Git repository | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # Step 2: Install Composer dependencies to regenerate `vendor/` | |
| - name: Install Composer Dependencies | |
| run: composer install --no-dev --optimize-autoloader -n | |
| # Step 3: Get the plugin version from the tag name | |
| - name: Get Version from Tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
| # Step 4: Build Plugin ZIP | |
| - name: Build Plugin ZIP | |
| run: | | |
| mkdir -p release | |
| rsync -rc --delete \ | |
| --exclude=".git*" \ | |
| --exclude=".github" \ | |
| --exclude="node_modules" \ | |
| --exclude="spa" \ | |
| --exclude="tests" \ | |
| --exclude="*.md" \ | |
| --exclude="composer.*" \ | |
| --exclude="package*.json" \ | |
| --exclude="webpack.config.js" \ | |
| --exclude="tailwind.config.js" \ | |
| --exclude="postcss.config.js" \ | |
| --exclude="*.sh" \ | |
| --exclude="svn*" \ | |
| ./ release/easyroadmap/ | |
| cd release | |
| zip -r easyroadmap.${VERSION}.zip easyroadmap | |
| # Step 5: Upload ZIP to GitHub Release | |
| - name: Upload ZIP to GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: release/easyroadmap.${{ env.VERSION }}.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |