Repository navigation
Add OCI plugin publishing #5
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
Open
fsimmend
wants to merge
6
commits into
main
Choose a base branch
from
marvel/fsi/add-oci-plugin-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
050a1a6
add oci plugin publishing to release and republish workflow for exist…
fsimmend f53ac5a
use separate nexus image secrets for public and ephemeral registries …
fsimmend 78459e5
select registry secrets explicitly per target registry to avoid falli…
fsimmend a11fd64
update oci-tooling actions to v0.2.0
fsimmend 9b2c285
update oci-tooling actions to v0.2.1
fsimmend 5aff4d9
only run manual oci republishing from the default branch
fsimmend 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
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
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,66 @@ | ||
| name: Republish Release as OCI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Existing release version (e.g., v3.0.0 or 3.0.0)' | ||
| type: string | ||
| required: true | ||
| target-registry: | ||
| description: 'Target registry (ephemeral also publishes; it is not a dry run)' | ||
| type: choice | ||
| required: true | ||
| default: public | ||
| options: | ||
| - public | ||
| - ephemeral | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| republish: | ||
| name: Republish existing release | ||
| # guards against accidental runs from other branches; it does not protect | ||
| # the secrets (that requires an environment with a deployment branch rule) | ||
| if: github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Validate inputs and registry credentials | ||
| id: validate | ||
| env: | ||
| RELEASE_VERSION: ${{ inputs.version }} | ||
| TARGET_REGISTRY: ${{ inputs.target-registry }} | ||
| REGISTRY_USERNAME: ${{ (inputs.target-registry == 'public' && secrets.NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_USERNAME) || (inputs.target-registry == 'ephemeral' && secrets.NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_USER) || '' }} | ||
| REGISTRY_PASSWORD: ${{ (inputs.target-registry == 'public' && secrets.NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_PASSWORD) || (inputs.target-registry == 'ephemeral' && secrets.NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_PASSWORD) || '' }} | ||
| run: | | ||
| VERSION="${RELEASE_VERSION#v}" | ||
| if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z]+([.-][0-9A-Za-z]+)*)?$ ]]; then | ||
| echo "::error::Version must be X.Y.Z with an optional v prefix and release suffix." | ||
| exit 1 | ||
| fi | ||
| if [[ "$TARGET_REGISTRY" != public && "$TARGET_REGISTRY" != ephemeral ]]; then | ||
| echo "::error::Target registry must be public or ephemeral." | ||
| exit 1 | ||
| fi | ||
| if [[ -z "$REGISTRY_USERNAME" || -z "$REGISTRY_PASSWORD" ]]; then | ||
| if [[ "$TARGET_REGISTRY" == public ]]; then | ||
| echo "::error::NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_USERNAME and NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_PASSWORD must be configured." | ||
| else | ||
| echo "::error::NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_USER and NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_PASSWORD must be configured." | ||
| fi | ||
| exit 1 | ||
| fi | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Republish release assets as OCI artifacts | ||
| uses: CoreMedia/oci-tooling/actions/republish-plugins@c91dc8dd03c9b6d1b0f13ee5d2cb3da42d9dc83a # v0.2.1 | ||
| with: | ||
| plugin-name: query-service | ||
| version: ${{ steps.validate.outputs.version }} | ||
| github-token: ${{ github.token }} | ||
| registry-username: ${{ (inputs.target-registry == 'public' && secrets.NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_USERNAME) || (inputs.target-registry == 'ephemeral' && secrets.NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_USER) || '' }} | ||
| registry-password: ${{ (inputs.target-registry == 'public' && secrets.NEXUS_GITHUB_ACTIONS_IMAGE_RELEASES_PASSWORD) || (inputs.target-registry == 'ephemeral' && secrets.NEXUS_GITHUB_ACTIONS_INTERNAL_IMAGES_PASSWORD) || '' }} | ||
| target-registry: ${{ inputs.target-registry }} | ||
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.
Uh oh!
There was an error while loading. Please reload this page.