Updating gitignore to not track vendor folder #1
Workflow file for this run
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
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@2.26.0 | |
with: | |
php-version: '8.2.11' | |
tools: composer | |
- name: Install dependencies | |
run: composer install --no-dev --optimize-autoloader | |
- name: Build release package | |
run: | | |
mkdir plugin-name | |
cp -R src/* plugin-name/ | |
sed -i 's|/src/src/|/src/|g' plugin-name/vendor/composer/autoload_classmap.php | |
sed -i 's|/src/src/|/src/|g' plugin-name/vendor/composer/autoload_static.php | |
zip -r plugin-name.zip plugin-name/ | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v0.1.15 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
name: ${{ env.VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: TukuToi/upload-release-asset@1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # Use the output from the create_release step | |
asset_path: ./plugin-name.zip | |
asset_name: plugin-name.zip | |
asset_content_type: application/zip |