diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5eca599..52bbb7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,21 +10,23 @@ jobs: name: Update version 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" @@ -41,7 +43,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 @@ -69,19 +71,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 @@ -95,13 +84,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 }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8fafcc9..31205d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,7 +49,7 @@ jobs: mysql -h 127.0.0.1 -uroot -proot -D wordpress -e "SHOW TABLES;" || echo "No tables found (yet)." - name: Checkout plugin - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: persist-credentials: false @@ -65,7 +65,7 @@ jobs: - name: Cache WordPress archive id: cache-wordpress - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: /tmp/wp key: wp-${{ matrix.wordpress }} @@ -79,11 +79,11 @@ jobs: rm wordpress-${WP_VERSION}.tar.gz - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Build FrankenPHP image (with cache) id: build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 env: DOCKER_BUILD_SUMMARY: false with: @@ -158,12 +158,12 @@ jobs: curl -s -o /dev/null -w "homepage: HTTP %{http_code} in %{time_total}s\n" http://localhost:8100/ - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v5 with: version: 10 - name: Setup Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: lts/* cache: "pnpm" @@ -175,7 +175,7 @@ jobs: run: npx playwright install --with-deps - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v5 with: path: vendor key: composer-${{ hashFiles('composer.lock') }} @@ -188,7 +188,7 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: test-results-php${{ matrix.php }}-wp${{ matrix.wordpress }} path: tests/Browser/Screenshots