From 99e821a7c347b1788355ca6faa2ee2c0c2912f59 Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Sat, 30 Aug 2025 10:17:32 +0900 Subject: [PATCH 1/2] Move CI from CircleCI to GitHub Actions --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 45 +++++++++++++++++++++++ 2 files changed, 118 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..eb20d04 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: Build MFA 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 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "18" + + - name: Install libs + run: sudo apt-get install --no-install-recommends -y libjson-perl libyaml-perl zip + + - name: Build plugin + run: | + perl Makefile.PL --version $(git describe --tags | sed -e 's/^v//') + make manifest + make zipdist + make dist + + - name: Upload all plugins + id: upload-all-plugins + uses: actions/upload-artifact@v4 + with: + name: plugin + path: | + MFA-* + + - name: Upload tarball + id: upload-tarball + uses: actions/upload-artifact@v4 + with: + name: tarball + path: | + MFA-*.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: | + packages/plugin/dist/*.zip + packages/plugin/dist/*.tar.gz diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9508465 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,45 @@ +name: Test +on: + push: + branches: + - "**/*" + tags: + - "v*" + - "*@v*" + +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 + - uses: actions/checkout@v4 + with: + 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 }}/plugins/MFA:/app/plugins/MFA \ + -v ${{ github.workspace }}/tools/MFA:/app/tools/MFA \ + -w /app \ + ghcr.io/movabletype/movabletype/test:${{ matrix.config.image }} \ + prove -j4 -PMySQLPool=MT::Test::Env -It/lib \ + plugins/MFA/t From 7697fb64902c3140c5cc713a07e3273e9afc1faf Mon Sep 17 00:00:00 2001 From: Taku Amano Date: Sat, 30 Aug 2025 10:32:54 +0900 Subject: [PATCH 2/2] Explicitly include dev dependencies --- Makefile.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index 4bd3fbd..57605f5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,7 +17,7 @@ WriteMakefile( sub MY::top_targets { << 'Makefile'; npm-install: - npm ci + npm ci --include=dev npm-build: npm run build