|
14 | 14 | workflow_dispatch: |
15 | 15 | inputs: |
16 | 16 | target: |
17 | | - description: Starter environment to validate (all is required to publish) |
| 17 | + description: Starter environment to build (select one to publish only that image) |
18 | 18 | required: true |
19 | 19 | default: auto |
20 | 20 | type: choice |
@@ -147,8 +147,8 @@ jobs: |
147 | 147 | ;; |
148 | 148 | esac |
149 | 149 |
|
150 | | - if [[ "$REQUESTED_PUBLISH" == "true" && "$REQUESTED_TARGET" != "all" ]]; then |
151 | | - echo "Publishing requires target=all so every image is validated together." >&2 |
| 150 | + if [[ "$REQUESTED_PUBLISH" == "true" && "$REQUESTED_TARGET" == "auto" ]]; then |
| 151 | + echo "Publishing requires an explicit target (or all); auto has no deterministic release scope." >&2 |
152 | 152 | exit 1 |
153 | 153 | fi |
154 | 154 |
|
@@ -366,68 +366,98 @@ jobs: |
366 | 366 | retention-days: 90 |
367 | 367 |
|
368 | 368 | - name: Log in to GHCR |
369 | | - if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && inputs.target == 'all' }} |
| 369 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }} |
370 | 370 | uses: docker/login-action@v3 |
371 | 371 | with: |
372 | 372 | registry: ghcr.io |
373 | 373 | username: ${{ github.actor }} |
374 | 374 | password: ${{ secrets.GITHUB_TOKEN }} |
375 | 375 |
|
376 | 376 | - name: Publish starter images |
377 | | - if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && inputs.target == 'all' }} |
| 377 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }} |
| 378 | + env: |
| 379 | + PUBLISH_BASE: ${{ steps.targets.outputs.base }} |
| 380 | + PUBLISH_PATHWAY: ${{ steps.targets.outputs.pathway }} |
| 381 | + PUBLISH_VISUALIZATION: ${{ steps.targets.outputs.visualization }} |
| 382 | + PUBLISH_STATISTICS: ${{ steps.targets.outputs.statistics }} |
378 | 383 | run: | |
| 384 | + set -euo pipefail |
| 385 | +
|
379 | 386 | base_version="$(tr -d '[:space:]' < starter-environments/r-base/VERSION)" |
380 | 387 | pathway_version="$(tr -d '[:space:]' < starter-environments/r-pathway/VERSION)" |
381 | 388 | visualization_version="$(tr -d '[:space:]' < starter-environments/r-visualization/VERSION)" |
382 | 389 | statistics_version="$(tr -d '[:space:]' < starter-environments/r-statistics/VERSION)" |
383 | | - docker tag omix-r-base:ci ghcr.io/nidap-community/omix-r-base:${{ github.sha }} |
384 | | - docker tag omix-r-base:ci ghcr.io/nidap-community/omix-r-base:"$base_version" |
385 | | - docker tag omix-r-pathway:ci ghcr.io/nidap-community/omix-r-pathway:${{ github.sha }} |
386 | | - docker tag omix-r-pathway:ci ghcr.io/nidap-community/omix-r-pathway:"$pathway_version" |
387 | | - docker push ghcr.io/nidap-community/omix-r-base:${{ github.sha }} |
388 | | - docker push ghcr.io/nidap-community/omix-r-base:"$base_version" |
389 | | - docker push ghcr.io/nidap-community/omix-r-pathway:${{ github.sha }} |
390 | | - docker push ghcr.io/nidap-community/omix-r-pathway:"$pathway_version" |
391 | | - if [[ "$visualization_version" == *-v0 ]]; then |
392 | | - echo "r-visualization is still a bootstrap definition; skipping publication until its CI-captured renv.lock is committed and VERSION is v1 or later." |
393 | | - else |
| 390 | +
|
| 391 | + if [[ "$PUBLISH_BASE" == "true" ]]; then |
| 392 | + docker tag omix-r-base:ci ghcr.io/nidap-community/omix-r-base:${{ github.sha }} |
| 393 | + docker tag omix-r-base:ci ghcr.io/nidap-community/omix-r-base:"$base_version" |
| 394 | + docker push ghcr.io/nidap-community/omix-r-base:${{ github.sha }} |
| 395 | + docker push ghcr.io/nidap-community/omix-r-base:"$base_version" |
| 396 | + fi |
| 397 | +
|
| 398 | + if [[ "$PUBLISH_PATHWAY" == "true" ]]; then |
| 399 | + docker tag omix-r-pathway:ci ghcr.io/nidap-community/omix-r-pathway:${{ github.sha }} |
| 400 | + docker tag omix-r-pathway:ci ghcr.io/nidap-community/omix-r-pathway:"$pathway_version" |
| 401 | + docker push ghcr.io/nidap-community/omix-r-pathway:${{ github.sha }} |
| 402 | + docker push ghcr.io/nidap-community/omix-r-pathway:"$pathway_version" |
| 403 | + fi |
| 404 | +
|
| 405 | + if [[ "$PUBLISH_VISUALIZATION" == "true" ]]; then |
| 406 | + if [[ "$visualization_version" == *-v0 ]]; then |
| 407 | + echo "r-visualization is still a bootstrap definition; commit its CI-captured renv.lock and change VERSION to v1 or later before publishing." >&2 |
| 408 | + exit 1 |
| 409 | + fi |
394 | 410 | docker tag omix-r-visualization:ci ghcr.io/nidap-community/omix-r-visualization:${{ github.sha }} |
395 | 411 | docker tag omix-r-visualization:ci ghcr.io/nidap-community/omix-r-visualization:"$visualization_version" |
396 | 412 | docker push ghcr.io/nidap-community/omix-r-visualization:${{ github.sha }} |
397 | 413 | docker push ghcr.io/nidap-community/omix-r-visualization:"$visualization_version" |
398 | 414 | fi |
399 | | - if [[ "$statistics_version" == *-v0 ]]; then |
400 | | - echo "r-statistics is still a bootstrap definition; skipping publication until its CI-captured renv.lock is committed and VERSION is v1 or later." |
401 | | - else |
| 415 | +
|
| 416 | + if [[ "$PUBLISH_STATISTICS" == "true" ]]; then |
| 417 | + if [[ "$statistics_version" == *-v0 ]]; then |
| 418 | + echo "r-statistics is still a bootstrap definition; commit its CI-captured renv.lock and change VERSION to v1 or later before publishing." >&2 |
| 419 | + exit 1 |
| 420 | + fi |
402 | 421 | docker tag omix-r-statistics:ci ghcr.io/nidap-community/omix-r-statistics:${{ github.sha }} |
403 | 422 | docker tag omix-r-statistics:ci ghcr.io/nidap-community/omix-r-statistics:"$statistics_version" |
404 | 423 | docker push ghcr.io/nidap-community/omix-r-statistics:${{ github.sha }} |
405 | 424 | docker push ghcr.io/nidap-community/omix-r-statistics:"$statistics_version" |
406 | 425 | fi |
407 | 426 |
|
408 | 427 | - name: Record published image digests |
409 | | - if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish && inputs.target == 'all' }} |
| 428 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish }} |
| 429 | + env: |
| 430 | + PUBLISH_BASE: ${{ steps.targets.outputs.base }} |
| 431 | + PUBLISH_PATHWAY: ${{ steps.targets.outputs.pathway }} |
| 432 | + PUBLISH_VISUALIZATION: ${{ steps.targets.outputs.visualization }} |
| 433 | + PUBLISH_STATISTICS: ${{ steps.targets.outputs.statistics }} |
410 | 434 | run: | |
| 435 | + set -euo pipefail |
| 436 | +
|
411 | 437 | base_version="$(tr -d '[:space:]' < starter-environments/r-base/VERSION)" |
412 | 438 | pathway_version="$(tr -d '[:space:]' < starter-environments/r-pathway/VERSION)" |
413 | 439 | visualization_version="$(tr -d '[:space:]' < starter-environments/r-visualization/VERSION)" |
414 | 440 | statistics_version="$(tr -d '[:space:]' < starter-environments/r-statistics/VERSION)" |
415 | | - base_ref="ghcr.io/nidap-community/omix-r-base:$base_version" |
416 | | - pathway_ref="ghcr.io/nidap-community/omix-r-pathway:$pathway_version" |
417 | | - statistics_ref="ghcr.io/nidap-community/omix-r-statistics:$statistics_version" |
418 | | - base_digest="$(docker buildx imagetools inspect "$base_ref" --format '{{.Manifest.Digest}}')" |
419 | | - pathway_digest="$(docker buildx imagetools inspect "$pathway_ref" --format '{{.Manifest.Digest}}')" |
420 | 441 | { |
421 | 442 | echo '## Published OMIX starter environments' |
422 | 443 | echo |
423 | | - echo "- \`$base_ref@$base_digest\`" |
424 | | - echo "- \`$pathway_ref@$pathway_digest\`" |
425 | | - if [[ "$visualization_version" != *-v0 ]]; then |
| 444 | + if [[ "$PUBLISH_BASE" == "true" ]]; then |
| 445 | + base_ref="ghcr.io/nidap-community/omix-r-base:$base_version" |
| 446 | + base_digest="$(docker buildx imagetools inspect "$base_ref" --format '{{.Manifest.Digest}}')" |
| 447 | + echo "- \`$base_ref@$base_digest\`" |
| 448 | + fi |
| 449 | + if [[ "$PUBLISH_PATHWAY" == "true" ]]; then |
| 450 | + pathway_ref="ghcr.io/nidap-community/omix-r-pathway:$pathway_version" |
| 451 | + pathway_digest="$(docker buildx imagetools inspect "$pathway_ref" --format '{{.Manifest.Digest}}')" |
| 452 | + echo "- \`$pathway_ref@$pathway_digest\`" |
| 453 | + fi |
| 454 | + if [[ "$PUBLISH_VISUALIZATION" == "true" ]]; then |
426 | 455 | visualization_ref="ghcr.io/nidap-community/omix-r-visualization:$visualization_version" |
427 | 456 | visualization_digest="$(docker buildx imagetools inspect "$visualization_ref" --format '{{.Manifest.Digest}}')" |
428 | 457 | echo "- \`$visualization_ref@$visualization_digest\`" |
429 | 458 | fi |
430 | | - if [[ "$statistics_version" != *-v0 ]]; then |
| 459 | + if [[ "$PUBLISH_STATISTICS" == "true" ]]; then |
| 460 | + statistics_ref="ghcr.io/nidap-community/omix-r-statistics:$statistics_version" |
431 | 461 | statistics_digest="$(docker buildx imagetools inspect "$statistics_ref" --format '{{.Manifest.Digest}}')" |
432 | 462 | echo "- \`$statistics_ref@$statistics_digest\`" |
433 | 463 | fi |
|
0 commit comments