From 0c210837b839576bef28a599ef4eb47d98cc8ad6 Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Tue, 25 Nov 2025 15:18:08 +0900 Subject: [PATCH 1/4] Bump version to 0.0.10 --- addons/PerformanceProfiler.pack/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/PerformanceProfiler.pack/config.yaml b/addons/PerformanceProfiler.pack/config.yaml index eb9c133..ea4870b 100644 --- a/addons/PerformanceProfiler.pack/config.yaml +++ b/addons/PerformanceProfiler.pack/config.yaml @@ -1,5 +1,5 @@ id: PerformanceProfiler -version: 0.0.9 +version: 0.0.10 description: <__trans phrase="Recored performace profile."> author_name: Six Apart Ltd. author_link: https://www.movabletype.org/ From c4ed8f0d7bcce29ad9af8a22784ccfa47e52be0d Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Tue, 25 Nov 2025 15:23:17 +0900 Subject: [PATCH 2/4] Add GitHub Actions --- .github/workflows/build.yml | 70 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 50 ++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f566312 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,70 @@ +name: Build PerformanceProfiler Plugin +on: + push: + branches: + - "**/*" + tags: + - "v*" + - "*@v*" + # pull_request: + # types: [opened, synchronize] + +jobs: + build: + runs-on: ubuntu-latest + env: + NODE_ENV: production + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install libs + run: sudo apt-get install --no-install-recommends -y libjson-perl libyaml-perl zip + + - name: Build plugin + run: | + perl Makefile.PL + make manifest + make zipdist + make dist + + - name: Upload all plugins + id: upload-all-plugins + uses: actions/upload-artifact@v4 + with: + name: plugin + path: | + PerformanceProfiler-* + + - name: Upload tarball + id: upload-tarball + uses: actions/upload-artifact@v4 + with: + name: tarball + path: | + PerformanceProfiler-*.tar.gz + + - name: Add comment to PR + uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 + if: ${{ github.event_name == 'pull_request' }} + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + ### Download Links + + You can download the build artifacts from the following links: + + - **All Plugins**: [Download from Actions Artifacts](${{ steps.upload-all-plugins.outputs.artifact-url }}) + - **Tarball**: [Download from Actions Artifacts](${{ steps.upload-tarball.outputs.artifact-url }}) + + - name: Upload package to GitHub Releases + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 + with: + draft: true + files: | + PerformanceProfiler-*.zip + PerformanceProfiler-*.tar.gz diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..18c61e4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,50 @@ +name: Test +on: + push: + branches: + - "**/*" + tags: + - "v*" + - "*@v*" + # pull_request: + # types: [opened, synchronize] + +jobs: + perl: + runs-on: ubuntu-latest + strategy: + matrix: + config: + - { image: cloud7 } + - { image: buster } + - { image: bullseye } + - { image: fedora35 } + - { image: fedora37 } + - { image: fedora40 } + - { image: fedora41 } + - { image: fedora42 } + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/checkout@v4 + with: + persist-credentials: false + repository: movabletype/movabletype + ref: develop + path: mt + - uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run tests + run: | + docker run --rm \ + -v ${{ github.workspace }}/mt:/app \ + -v ${{ github.workspace }}/addons/PerformanceProfiler.pack:/app/addons/PerformanceProfiler.pack \ + -w /app \ + -e MT_TEST_ENV_ADMIN_THEME_ID=${{ matrix.admin_theme_id }} \ + ghcr.io/movabletype/movabletype/test:${{ matrix.config.image }} \ + prove -j4 -PMySQLPool=MT::Test::Env -It/lib \ + addons/PerformanceProfiler.pack/t From b7745853c77ba790cf90aff720d2d1edf04384a8 Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Tue, 25 Nov 2025 16:20:35 +0900 Subject: [PATCH 3/4] install Devel::NYTProf --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18c61e4..58984a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,5 +46,4 @@ jobs: -w /app \ -e MT_TEST_ENV_ADMIN_THEME_ID=${{ matrix.admin_theme_id }} \ ghcr.io/movabletype/movabletype/test:${{ matrix.config.image }} \ - prove -j4 -PMySQLPool=MT::Test::Env -It/lib \ - addons/PerformanceProfiler.pack/t + bash -c 'cpm install -g Devel::NYTProf && prove -j4 -PMySQLPool=MT::Test::Env -It/lib addons/PerformanceProfiler.pack/t' From d8b3d2ed5376358c499ab4fac957b2681ad6c442 Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Wed, 26 Nov 2025 12:24:53 +0900 Subject: [PATCH 4/4] Fix archive file names --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f566312..0e46366 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: with: name: plugin path: | - PerformanceProfiler-* + mt-plugin-PerformanceProfiler-* - name: Upload tarball id: upload-tarball @@ -45,7 +45,7 @@ jobs: with: name: tarball path: | - PerformanceProfiler-*.tar.gz + mt-plugin-PerformanceProfiler-*.tar.gz - name: Add comment to PR uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 @@ -66,5 +66,5 @@ jobs: with: draft: true files: | - PerformanceProfiler-*.zip - PerformanceProfiler-*.tar.gz + mt-plugin-PerformanceProfiler-*.zip + mt-plugin-PerformanceProfiler-*.tar.gz