Skip to content

Commit 6aa709a

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 c3747fe commit 6aa709a

19 files changed

Lines changed: 629 additions & 1326 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.3
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
@@ -4,3 +4,6 @@ node_modules
44
.DS_Store
55
.idea
66
/GoogleTranslate
7+
8+
# 配布 zip は release.yml が tag 時にビルドして GitHub Release へ公開するため管理外
9+
/build/

‎.node-version‎

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

‎build/GoogleTranslate.zip‎

-3.11 MB
Binary file not shown.

‎composer.json‎

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11
{
22
"name": "com.appleple/google-translate",
33
"description": "a-blog cms extension.",
4+
"autoload": {
5+
"psr-4": {
6+
"Acms\\Plugins\\GoogleTranslate\\": "src/"
7+
}
8+
},
49
"scripts": {
510
"lint": "vendor/bin/phpcs --standard=phpcs.xml",
611
"format": "vendor/bin/phpcbf --standard=phpcs.xml",
7-
"check:version": "vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 8.1-8.4 --ignore=./src/vendor/* ./src",
12+
"check:version": "vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 8.1-8.5 --ignore=./src/vendor/* ./src",
813
"post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
9-
"post-update-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility"
14+
"post-update-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility",
15+
"package": "@php scripts/package.php",
16+
"version:set": "@php scripts/version.php",
17+
"release:patch": "@php scripts/release.php patch",
18+
"release:minor": "@php scripts/release.php minor",
19+
"release:major": "@php scripts/release.php major"
1020
},
1121
"require-dev": {
1222
"squizlabs/php_codesniffer": "^3.13",
13-
"phpcompatibility/php-compatibility": "^9.3",
23+
"phpcompatibility/php-compatibility": "^10.0@dev",
1424
"dealerdirect/phpcodesniffer-composer-installer": "^1.1"
1525
},
26+
"extra": {
27+
"acms-plugin-tools": {
28+
"extras": ["docs"]
29+
}
30+
},
1631
"prefer-stable" : true,
1732
"config": {
1833
"platform": {
19-
"php": "8.3"
34+
"php": "8.5.0"
2035
},
2136
"allow-plugins": {
22-
"dealerdirect/phpcodesniffer-composer-installer": true
37+
"dealerdirect/phpcodesniffer-composer-installer": true,
38+
"phpcsstandards/composer-installer": true
2339
}
2440
}
2541
}

‎composer.lock‎

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

‎docs/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ a-blog cms のための「Google Translation API」連携拡張アプリにな
1111

1212
## ダウンロード
1313

14-
[Google Translate for a-blog cms](https://github.com/appleple/acms-google-translate/raw/master/build/GoogleTranslate.zip)
14+
[Google Translate for a-blog cms](https://github.com/appleple/acms-google-translate/releases/latest/download/GoogleTranslate.zip)
1515

1616
## 事前準備
1717

@@ -65,7 +65,7 @@ a-blog cms のための「Google Translation API」連携拡張アプリにな
6565

6666
## インストール
6767

68-
1. [Google Translate for a-blog cms](https://github.com/appleple/acms-google-translate/raw/master/build/GoogleTranslate.zip) から
68+
1. [Google Translate for a-blog cms](https://github.com/appleple/acms-google-translate/releases/latest/download/GoogleTranslate.zip) から
6969
zipファイルをダウンロードし、解凍したディレクトリ(GoogleTranslate)を **extension/plugins/** に設置する。
7070

7171
1. 管理者で a-blog cms にログインし、 拡張アプリに移動し、「GoogleTranslate」をインストールします。

0 commit comments

Comments
 (0)