Skip to content

5402: Generate release.json on image build and release tarball#416

Merged
turegjorup merged 1 commit into
feature/update-infrastructure-for-mono-repofrom
feature/5402-release-json
Apr 30, 2026
Merged

5402: Generate release.json on image build and release tarball#416
turegjorup merged 1 commit into
feature/update-infrastructure-for-mono-repofrom
feature/5402-release-json

Conversation

@turegjorup
Copy link
Copy Markdown
Contributor

Summary

Both Dockerfiles, infrastructure/build-n-push.sh, and github_build_release.yml now write public/release.json so the client's assets/shared/release-loader.js finds the file at /release.json instead of falling back to defaults. The shape matches the existing docs/release-example.json:

{"releaseTimestamp": 1777459916, "releaseTime": "Wed Apr 29 10:51:56 UTC 2026", "releaseVersion": "3.0.0"}

Mirrors itk-dev#2's approach.

What changed

  • infrastructure/display-api-service/Dockerfileapi_app_builder stage gets ARG APP_RELEASE_TIMESTAMP + ARG APP_RELEASE_TIME and a RUN printf … > public/release.json step after the final composer install.
  • infrastructure/nginx/Dockerfile — same change in its self-contained api_app_builder stage so the nginx image's public/ (which is what's actually served) carries the file.
  • infrastructure/build-n-push.sh — captures RELEASE_TIME="$(date -u)" alongside the existing RELEASE_TIMESTAMP, passes both as build args. Drops the unused APP_RELEASE_VERSION (APP_VERSION covers it).
  • .github/workflows/build-images.yml — adds a Set release timestamp step that exports APP_RELEASE_TIMESTAMP and APP_RELEASE_TIME to $GITHUB_ENV, and passes them as build args. Replaces the broken APP_RELEASE_TIMESTAMP=${{ github.run_number }} (which was never a unix timestamp).
  • .github/workflows/github_build_release.yml:
    • Inlines the steps from the now-removed .github/Taskfile.yml (only consumer of that file).
    • Adds a Write release.json step before tarballing.
    • Adds the missing Detect pre-release step the workflow was already trying to reference (steps.prerelease.outputs.flag — previously empty). RC tags like 3.0.0-RC1 now publish as GitHub pre-releases, mirroring the flavor: latest=auto rule in build-images.yml.
    • Cleanup step now mirrors .dockerignore minus vendor/ and public/build/ (which the workflow just produced and the tarball needs to ship).
  • .github/Taskfile.yml — removed.

Local validation

Built both images from this branch and confirmed release.json is present and correct in both:

$ docker run --rm --entrypoint cat local/display-api-service:rj-test /var/www/html/public/release.json
{"releaseTimestamp": 1777459916, "releaseTime": "Wed Apr 29 10:51:56 UTC 2026", "releaseVersion": "rj-test"}

$ docker run --rm --entrypoint cat local/display-api-service-nginx:rj-test /var/www/html/public/release.json
{"releaseTimestamp": 1777459916, "releaseTime": "Wed Apr 29 10:51:56 UTC 2026", "releaseVersion": "rj-test"}

Test plan

  • Push to developbuild-images.yml produces :develop images that contain /release.json with releaseVersion: "develop".
  • Tag 3.0.0-RC1:3.0.0-RC1 image carries releaseVersion: "3.0.0-RC1"; github_build_release.yml publishes the GitHub Release as a pre-release; :latest is not updated on either side.
  • Tag 3.0.0:3.0.0 image carries releaseVersion: "3.0.0"; github_build_release.yml publishes a final (non-pre-) GitHub Release; :latest is updated.
  • assets/shared/release-loader.js no longer logs Could not find release.json. Returning defaults. in the deployed apps.

🤖 Generated with Claude Code

Mirrors itk-dev#2. Inlines the .github/Taskfile
into github_build_release.yml and aligns its cleanup with .dockerignore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup turegjorup requested a review from tuj April 29, 2026 11:08
@turegjorup turegjorup self-assigned this Apr 29, 2026
@turegjorup turegjorup merged commit 8caf533 into feature/update-infrastructure-for-mono-repo Apr 30, 2026
18 checks passed
@turegjorup turegjorup deleted the feature/5402-release-json branch April 30, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants