-
Notifications
You must be signed in to change notification settings - Fork 15
Publish Docker images to Docker Hub and GHCR #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+52
−0
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright 2024 Intel Corporation | ||
| # Copyright 2025 Canonical Ltd. | ||
| name: Release Pipeline | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "VERSION" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # CAUTION: Other actions depend on this name "tag-github" | ||
| tag-github: | ||
| uses: onosproject/.github/.github/workflows/tag-github.yml@main | ||
| secrets: inherit | ||
|
|
||
| release-image: | ||
| needs: tag-github | ||
| if: needs.tag-github.outputs.changed == 'true' | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| actions: read | ||
| id-token: write | ||
| attestations: write | ||
| uses: onosproject/.github/.github/workflows/release-image.yml@main | ||
| with: | ||
| # Prefix the version with 'v' to follow tagging conventions | ||
| docker_tag: v${{ needs.tag-github.outputs.version }} | ||
| secrets: inherit | ||
|
|
||
| update-version: | ||
| needs: tag-github | ||
| if: needs.tag-github.outputs.changed == 'true' | ||
| uses: onosproject/.github/.github/workflows/bump-version.yml@main | ||
| secrets: inherit | ||
| with: | ||
| # Prefix the version with 'v' to follow tagging conventions | ||
| version: v${{ needs.tag-github.outputs.version }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gemini highlighted a "Parallel Execution" Risk
Currently,
release-imageandupdate-versionrun in parallel because they both only depend ontag-github.The Problem: If
release-imagefails (e.g., Docker registry is down, build error),update-versionmight still succeed. The Result: Your repository will bump the version (e.g., to1.2.4-SNAPSHOT), but the artifact for1.2.3was never published. You end up in a "zombie state" where the git history says the release is done, but the container registry is empty.The Fix: Make
update-versiondepend on the success ofrelease-image.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I partially agree with this comment/suggestion. What happens if the
release-imagefail? Image is not published and VERSION is NOT updated (update-versiondoes not run). So, you have to manually (re)trigger therelease-imageaction again until it is successful and then you need to manually trigger theupdate-versionaction.On the other hand, if we leave the parallelism there,
update-versionwill always run (based ontag-github) and you have to manually (re)trigger therelease-imageaction if needed, which is the approach we took for thesd-coreThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @gab-arrobo points out, it's not entirely clear what is the ideal behavior if the
release_imagejob fails. It sounds like leaving as-is will at least keep the behavior consistent withsd-coreso I'm inclined to do that.