Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gbissland authored Feb 27, 2025
1 parent 5240f29 commit aeb8ef8
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Plugin Release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest

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

- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer

# Uncomment if you have Composer dependencies
# - name: Install dependencies
# run: composer install --no-dev --optimize-autoloader

- name: Create build directory
run: mkdir -p build/weave-cache-purge-helper

- name: Copy plugin files to build directory
run: |
rsync -av --exclude='.git' \
--exclude='.github' \
--exclude='build' \
--exclude='.gitignore' \
--exclude='README.md' \
--exclude='CHANGELOG.md' \
--exclude='composer.json' \
--exclude='composer.lock' \
--exclude='.DS_Store' \
--exclude='.nova' \
--exclude='node_modules' \
--exclude='package.json' \
--exclude='package-lock.json' \
--exclude='phpcs.xml' \
--exclude='phpunit.xml' \
--exclude='tests' \
. build/weave-cache-purge-helper/
- name: Create zip file
run: cd build && zip -r weave-cache-purge-helper-${{ env.VERSION }}.zip weave-cache-purge-helper

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: build/weave-cache-purge-helper-${{ env.VERSION }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit aeb8ef8

Please sign in to comment.