From aeb8ef8c63af885f0a3ee57c319d8667548903a0 Mon Sep 17 00:00:00 2001 From: Gareth Bissland <5170216+gbissland@users.noreply.github.com> Date: Fri, 28 Feb 2025 06:50:27 +1300 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddcf4e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }}