Skip to content

Commit c9a0d8c

Browse files
uidev1116claude
andcommitted
リリース基盤を PHP(composer scripts) へ移行し PHP 8.5 対応設定を反映
JS(package.json/tools) を廃し共通 scripts/*.php + composer scripts に統一。GitHub 配布は release.yml が tag で zip をビルドし GitHub Release 公開(build/ は Git 管理外・README を Releases リンクに)。あわせて PHP 8.5 対応として config.platform.php=8.5.0、phpcompatibility/php-compatibility を ^10.0@dev、CI(ci.yaml)の PHP を 8.5 に。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0c89223 commit c9a0d8c

19 files changed

Lines changed: 627 additions & 1285 deletions

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
container:
11-
image: php:8.4
11+
image: php:8.5
1212

1313
steps:
1414
- name: Checkout code

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
# 配布用 zip(scripts/package.php)をビルドし、GitHub Release として公開する。
4+
# v1.2.3 のようなタグを push すると発火する。
5+
#
6+
# プラグインのバージョンは src/ServiceProvider.php の $version が正。タグとこの値を一致させること
7+
# (下の Verify ステップで不一致なら失敗させ、食い違った zip を公開しないようにしている)。
8+
9+
on:
10+
push:
11+
tags:
12+
- 'v*'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Set up PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: '8.5'
29+
extensions: zip
30+
tools: composer
31+
32+
- name: Verify tag matches ServiceProvider $version
33+
run: php scripts/package.php --check-version="${GITHUB_REF_NAME#v}"
34+
35+
- name: Create release package
36+
run: php scripts/package.php
37+
38+
- name: Create GitHub Release
39+
run: |
40+
gh release create "${GITHUB_REF_NAME}" \
41+
--title "${GITHUB_REF_NAME}" \
42+
--generate-notes \
43+
./build/*.zip
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ node_modules/
2121
# PHP
2222
vendor
2323
.phplint-cache
24+
25+
# 配布 zip は release.yml が tag 時にビルドして GitHub Release へ公開するため管理外
26+
/build/

.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/GoogleAnalytics4.zip

-2.71 MB
Binary file not shown.

composer.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,40 @@
11
{
22
"name": "com.appleple/acms-google-analytics4",
33
"description": "Google Analytics4(GA4)と連携するための拡張アプリです。",
4+
"autoload": {
5+
"psr-4": {
6+
"Acms\\Plugins\\GoogleAnalytics4\\": "src/"
7+
}
8+
},
49
"scripts": {
510
"lint": [
611
"vendor/bin/phpcs --standard=phpcs.xml || true"
712
],
813
"format": [
914
"vendor/bin/phpcbf --standard=phpcs.xml"
10-
]
15+
],
16+
"package": "@php scripts/package.php",
17+
"version:set": "@php scripts/version.php",
18+
"release:patch": "@php scripts/release.php patch",
19+
"release:minor": "@php scripts/release.php minor",
20+
"release:major": "@php scripts/release.php major"
1121
},
1222
"require-dev": {
13-
"squizlabs/php_codesniffer": "3.*"
23+
"squizlabs/php_codesniffer": "3.*",
24+
"phpcompatibility/php-compatibility": "^10.0@dev"
25+
},
26+
"extra": {
27+
"acms-plugin-tools": {
28+
"extras": ["docs"]
29+
}
1430
},
1531
"config": {
32+
"allow-plugins": {
33+
"dealerdirect/phpcodesniffer-composer-installer": true,
34+
"phpcsstandards/composer-installer": true
35+
},
1636
"platform": {
17-
"php": "8.4"
37+
"php": "8.5.0"
1838
}
1939
}
2040
}

composer.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Google Analytics 4(GA4)と連携するための拡張アプリです。
99

1010
## ダウンロード
1111

12-
[Google Analytics 4](https://github.com/appleple/acms-google-analytics4/raw/master/build/GoogleAnalytics4.zip)
12+
[Google Analytics 4](https://github.com/appleple/acms-google-analytics4/releases/latest/download/GoogleAnalytics4.zip)
1313

1414
## インストール方法
1515

0 commit comments

Comments
 (0)