Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@ on:
workflow_dispatch: # Allows manual triggering

jobs:
e2e:
uses: ./.github/workflows/tests.yml

update:
name: Update version
needs: e2e
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write

steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0 # Fetch all history so we can access tags and commits
fetch-tags: true # Ensure tags are fetched

- name: Install pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v5
with:
version: 10

- name: Install Node.js LTS
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: "pnpm"
Expand All @@ -41,7 +47,7 @@ jobs:
php-version: "latest"

- name: Install Composer
uses: ramsey/composer-install@v3
uses: ramsey/composer-install@v4

- name: Downgrade PHP code to the minimum version WordPress requires
run: vendor/bin/rector --ansi
Expand Down Expand Up @@ -69,19 +75,6 @@ jobs:
# Push changes, handling potential conflicts
git push || git pull --rebase origin ${{ github.ref_name }} && git push

- name: Create release
id: release
if: steps.script.outputs.has-changed == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.script.outputs.stable-tag }}
release_name: ${{ steps.script.outputs.release-name }}
body: ${{ steps.script.outputs.release-body }}
draft: false
prerelease: false

- name: WordPress Plugin Deploy
if: steps.script.outputs.has-changed == 'true'
id: deploy
Expand All @@ -95,13 +88,20 @@ jobs:
VERSION: ${{ steps.script.outputs.stable-tag }}
ASSETS_DIR: assets

- name: Upload release asset
- name: Name release zip like repository
if: steps.script.outputs.has-changed == 'true'
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: release_zip
run: |
cp "${{ steps.deploy.outputs.zip-path }}" "${{ github.workspace }}/${{ github.event.repository.name }}.zip"
echo "path=${{ github.workspace }}/${{ github.event.repository.name }}.zip" >> "$GITHUB_OUTPUT"

- name: Create GitHub release
if: steps.script.outputs.has-changed == 'true'
uses: softprops/action-gh-release@v2
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
tag_name: ${{ steps.script.outputs.stable-tag }}
name: ${{ steps.script.outputs.release-name }}
body: ${{ steps.script.outputs.release-body }}
draft: false
prerelease: false
files: ${{ steps.release_zip.outputs.path }}
Loading
Loading