diff --git a/.gitea/workflows/plugin-checks.yml b/.gitea/workflows/plugin-checks.yml index 840c925..71c3f8b 100644 --- a/.gitea/workflows/plugin-checks.yml +++ b/.gitea/workflows/plugin-checks.yml @@ -22,26 +22,24 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Check version bump and changelog entry + # The version must be higher than the latest *published release* (not just higher than main), so main can + # carry a version whose release failed or was withdrawn without blocking the next PR. + - name: Check version is unreleased and changelog entry exists + env: + TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | set -e PR_VERSION=$(grep -m1 '"version"' composer.json | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/') - MAIN_VERSION=$(git show origin/main:composer.json | grep -m1 '"version"' | sed -E 's/.*"version"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/') + LATEST=$(curl -sf -H "Authorization: token ${TOKEN}" "${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases?limit=100" \ + | jq -r '.[].tag_name' | sed 's/^v//' | sort -V | tail -n1) + LATEST="${LATEST:-0.0.0}" - echo "main version: $MAIN_VERSION" - echo "PR version: $PR_VERSION" + echo "latest release: $LATEST" + echo "PR version: $PR_VERSION" - if [ "$MAIN_VERSION" = "$PR_VERSION" ]; then - echo "::error::composer.json version ($PR_VERSION) was not bumped from main ($MAIN_VERSION)" - exit 1 - fi - - HIGHEST=$(printf '%s\n%s\n' "$MAIN_VERSION" "$PR_VERSION" | sort -V | tail -n1) - if [ "$HIGHEST" != "$PR_VERSION" ]; then - echo "::error::composer.json version ($PR_VERSION) is not greater than main's ($MAIN_VERSION)" + if [ "$PR_VERSION" = "$LATEST" ] || [ "$(printf '%s\n%s\n' "$LATEST" "$PR_VERSION" | sort -V | tail -n1)" != "$PR_VERSION" ]; then + echo "::error::composer.json version ($PR_VERSION) is not greater than the latest release ($LATEST)" exit 1 fi @@ -50,7 +48,7 @@ jobs: exit 1 fi - echo "OK: version bumped to $PR_VERSION and documented in CHANGELOG.md" + echo "OK: $PR_VERSION is unreleased and documented in CHANGELOG.md" # Packages the extension (builds admin/storefront assets) and validates the resulting zip, # which is the artifact that ships. A separate directory validate would only repeat these checks. diff --git a/CHANGELOG.md b/CHANGELOG.md index 9261827..dbe3c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,27 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.1.1] - 2026-10-04 - -### Fixed - -- The packaged zip no longer contains `.gitea/` and `.config/`. -- Release pipeline: the Composer registry rejected the packaged zip (`composer.json file is missing`) because `shopware-cli` zips wrap everything in a top-level folder. The same prebuilt content is now repacked root-level for the registry upload. -- Release steps are idempotent (existing release and asset are reused, registry 409 counts as published) and the "tag exists -> skip" guard is gone, so a failed release can be re-run to completion. - -## [0.1.0] - 2026-10-03 +## [0.0.6] - 2026-10-04 ### Changed - Services and routes are now configured in YAML; the plugin requires PHP `^8.2`. -- Release pipeline: the packaged `shopware-cli` zip (with prebuilt assets) is validated and used for both the Gitea Release and the Composer registry; the release is created through the Gitea API after packaging, so a failed build no longer leaves an orphan tag. -- New PR checks: `shopware-cli` validate, package build and phpunit. +- Release pipeline: the packaged `shopware-cli` zip (with prebuilt assets) is validated and used for the Gitea Release; the Composer registry gets the same content repacked root-level (Gitea requires `composer.json` at the zip root). The release is created through the Gitea API after packaging, so a failed build no longer leaves an orphan tag. +- New PR checks: `shopware-cli` validate, package build and phpunit (with a cached Shopware project and database). +- The PR version check compares against the latest published release instead of the version on `main`. ### Added - Dedicated `aeon_dump_manager` monolog channel; dump jobs, deletions and purges are logged. - Extension icon and `.config/shopware-extension.yml`. +### Fixed + +- The packaged zip no longer contains `.gitea/` and `.config/`. +- Release steps are idempotent (existing release and asset are reused, registry 409 counts as published), so a failed release can be re-run to completion. + ### Removed - Empty plugin lifecycle overrides. diff --git a/CLAUDE.md b/CLAUDE.md index 65af51a..4923555 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -77,8 +77,9 @@ Gitea workflows in `.gitea/`, plugin-agnostic (name/version come from `composer. runs from its official Docker image, intentionally unpinned (`latest`): a red build after a CLI release means fix the config. -- `workflows/plugin-checks.yml` (PRs into `main`) has three jobs: `version-changelog` (every PR into - `main` must bump `composer.json` version and add a matching `## [x.y.z]` CHANGELOG heading), `package` +- `workflows/plugin-checks.yml` (PRs into `main`) has three jobs: `version-changelog` (the + `composer.json` version must be greater than the latest published Gitea release and have a matching + `## [x.y.z]` CHANGELOG heading), `package` (shared composite action `actions/package`: `shopware-cli extension package`, `extension validate` on the zip, `scripts/ci/assert-built-assets.sh`), and `phpunit`. The package job caches the tested zip keyed by the commit's tree hash. diff --git a/composer.json b/composer.json index 2bab846..01f6008 100755 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Export database dumps for Shopware 6 environments.", "type": "shopware-platform-plugin", "license": "MIT", - "version": "0.1.1", + "version": "0.0.6", "keywords": [ "shopware", "shopware6",