-
Notifications
You must be signed in to change notification settings - Fork 482
ci(maven): publish artifacts to BunnyCDN S3 instead of Artifactory #37568
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
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9066c98
ci(maven): publish artifacts to BunnyCDN S3 instead of Artifactory
wezell 87c60bd
fix(publish-to-s3): filter PRE lines when rebuilding maven-metadata.xml
wezell dececd5
fix(publish-to-s3): prefer Bunny credentials and keep variants out of…
wezell d7f7d0f
fix(cli-release): publish the CLI runner jar to S3 explicitly
wezell f95f289
style(publish-to-s3): declare plain local in update_artifact_metadata
wezell 3a2ed4f
fix(cli-release): honor dry-run for the runner-jar S3 publish
wezell ff2829d
feat(publish-to-s3): write checksum sidecars in file mode
wezell 75abb2e
refactor(deploy): rename deploy-maven-s3 action to deploy-bunny-maven-s3
wezell f18747a
fix(cli-release): drop the Artifactory uploader; publish CLI artifact…
wezell 3637a88
fix(cli-release): use jreleaser:release, not full-release
wezell 66b947f
fix(publish-to-s3): fail when requested modules are absent
wezell 2607513
fix(publish-to-s3): don't truncate maven-metadata.xml when ls fails
wezell 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
48 changes: 48 additions & 0 deletions
48
.github/actions/core-cicd/deployment/deploy-bunny-maven-s3/README.md
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,48 @@ | ||
| # Deploy Maven Artifacts to S3 | ||
|
|
||
| Publishes the locally-installed dotCMS Maven artifacts to the BunnyCDN | ||
| S3-compatible repository. This replaces the former `deploy-jfrog` (Artifactory) | ||
| action. | ||
|
|
||
| The action restores the `maven-repo` artifact produced by the build phase, | ||
| resolves the project version, and delegates the upload to | ||
| [`.github/scripts/publish-to-s3/publish.sh`](../../../../scripts/publish-to-s3/README.md). | ||
| The script preserves the `com/dotcms/<artifactId>/<version>` layout, writes | ||
| `.sha1`/`.md5` checksums, and regenerates the `maven-metadata.xml` files that | ||
| Artifactory used to create. | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Input | Required | Default | Description | | ||
| | --- | --- | --- | --- | | ||
| | `version` | no | project version | Version to publish. Set it when the restored `maven-repo` artifact was built from a different ref than the checked-out POM (e.g. releases). | | ||
| | `modules` | no | all modules for the version | Comma-separated artifactIds to restrict the publish to. | | ||
| | `exclude-ext` | no | `repositories,excludeext` | Extra file extensions to skip. | | ||
| | `dry-run` | no | `false` | Print what would be uploaded without writing. | | ||
| | `bucket` | no | `MAVEN_BUNNY_RW_USERNAME` | S3 bucket / Bunny storage zone. | | ||
| | `prefix` | no | `libs-release` | Key prefix inside the bucket. | | ||
| | `endpoint` | no | `https://ny-s3.storage.bunnycdn.com` | S3 endpoint URL. | | ||
| | `region` | no | `ny` | S3 signing region. | | ||
| | `access-key-id` | **yes** | — | S3 access key id (Bunny storage-zone name). | | ||
| | `secret-access-key` | **yes** | — | S3 secret access key (Bunny storage-zone password). | | ||
| | `checksums` | no | `true` | Upload `.sha1`/`.md5` checksums. | | ||
| | `github-token` | **yes** | — | Token used to download the `maven-repo` artifact. | | ||
| | `artifact-run-id` | no | `${{ github.run_id }}` | Run id that holds the `maven-repo` artifact. | | ||
|
|
||
| ## Example | ||
|
|
||
| ```yaml | ||
| - name: Deploy Maven artifacts | ||
| uses: ./.github/actions/core-cicd/deployment/deploy-bunny-maven-s3 | ||
| with: | ||
| access-key-id: ${{ secrets.MAVEN_BUNNY_RW_USERNAME }} | ||
| secret-access-key: ${{ secrets.MAVEN_BUNNY_RW_PASSWORD }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| artifact-run-id: ${{ inputs.artifact-run-id }} | ||
| ``` | ||
|
|
||
| Public URL for the above with the defaults: | ||
|
|
||
| ``` | ||
| https://dotcms-repo.b-cdn.net/libs-release/com/dotcms/<artifactId>/<version>/<artifactId>-<version>.jar | ||
| ``` |
113 changes: 113 additions & 0 deletions
113
.github/actions/core-cicd/deployment/deploy-bunny-maven-s3/action.yml
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,113 @@ | ||
| name: 'Deploy Maven Artifacts to Bunny S3' | ||
| description: | | ||
| Publish the locally-installed dotCMS Maven artifacts to the BunnyCDN | ||
| S3-compatible storage zone. This replaces the former Artifactory | ||
| (deploy-jfrog) deployment. | ||
|
|
||
| The action restores the `maven-repo` artifact produced by the build phase, | ||
| resolves the project version, then delegates to | ||
| `.github/scripts/publish-to-s3/publish.sh maven`, which uploads every | ||
| com/dotcms module for that version and regenerates maven-metadata.xml. | ||
|
|
||
| inputs: | ||
| version: | ||
| description: 'Version of the artifacts to deploy. Defaults to the project version in the checked-out POM.' | ||
| required: false | ||
| modules: | ||
| description: 'Comma-separated artifactIds to publish. Defaults to every com/dotcms module with a directory for the version.' | ||
| required: false | ||
| exclude-ext: | ||
| description: 'Comma-separated file extensions to skip.' | ||
| required: false | ||
| default: 'repositories,excludeext' | ||
| dry-run: | ||
| description: 'Enable dry-run mode (no writes).' | ||
| required: false | ||
| bucket: | ||
| description: 'S3 bucket / Bunny storage zone. Defaults to MAVEN_BUNNY_RW_USERNAME.' | ||
| required: false | ||
| prefix: | ||
| description: 'Key prefix inside the bucket.' | ||
| required: false | ||
| default: 'libs-release' | ||
| endpoint: | ||
| description: 'S3 endpoint URL.' | ||
| required: false | ||
| default: 'https://ny-s3.storage.bunnycdn.com' | ||
| region: | ||
| description: 'S3 signing region.' | ||
| required: false | ||
| default: 'ny' | ||
| access-key-id: | ||
| description: 'S3 access key id (Bunny storage-zone name).' | ||
| required: true | ||
| secret-access-key: | ||
| description: 'S3 secret access key (Bunny storage-zone password).' | ||
| required: true | ||
| checksums: | ||
| description: 'Upload .sha1/.md5 checksums alongside the artifacts.' | ||
| required: false | ||
| default: 'true' | ||
| github-token: | ||
| description: 'GitHub Token' | ||
| required: true | ||
| artifact-run-id: | ||
| default: ${{ github.run_id }} | ||
| description: 'The run id of the core artifacts' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - uses: ./.github/actions/core-cicd/maven-job | ||
| with: | ||
| github-token: ${{ inputs.github-token }} | ||
| stage-name: "Deploy Artifacts Validate" | ||
| maven-args: "validate" # No build needed; only restore the maven-repo artifact | ||
| artifacts-from: ${{ inputs.artifact-run-id }} | ||
|
|
||
| - name: 'Extract project version' | ||
| if: ${{ inputs.version == '' || inputs.version == null }} | ||
| id: maven-version | ||
| shell: bash | ||
| run: | | ||
| echo "::group::Extract project version" | ||
| version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
| echo "::notice::version: $version" | ||
| echo "version=$version" >> $GITHUB_OUTPUT | ||
| echo "::endgroup::" | ||
|
|
||
| - name: 'Deploy artifacts to S3' | ||
| shell: bash | ||
| env: | ||
| MAVEN_BUNNY_RW_USERNAME: ${{ inputs.access-key-id }} | ||
| MAVEN_BUNNY_RW_PASSWORD: ${{ inputs.secret-access-key }} | ||
| MAVEN_S3_ENDPOINT: ${{ inputs.endpoint }} | ||
| MAVEN_S3_REGION: ${{ inputs.region }} | ||
| MAVEN_S3_BUCKET: ${{ inputs.bucket }} | ||
| MAVEN_S3_PREFIX: ${{ inputs.prefix }} | ||
| VERSION: ${{ inputs.version || steps.maven-version.outputs.version }} | ||
| PRJ_MODULES: ${{ inputs.modules }} | ||
| EXCLUDE_EXT: ${{ inputs.exclude-ext }} | ||
| DRY_RUN_MODE: ${{ inputs.dry-run }} | ||
| CHECKSUMS: ${{ inputs.checksums }} | ||
| run: | | ||
| echo "::group::Deploy Artifacts to S3" | ||
| args=(maven --version "$VERSION" --exclude-ext "$EXCLUDE_EXT") | ||
|
|
||
| if [[ -n "${PRJ_MODULES:-}" ]]; then | ||
| args+=(--modules "$PRJ_MODULES") | ||
| fi | ||
| if [[ -n "${MAVEN_S3_BUCKET:-}" ]]; then | ||
| args+=(--bucket "$MAVEN_S3_BUCKET") | ||
| fi | ||
| if [[ "${DRY_RUN_MODE:-false}" == "true" ]]; then | ||
| args+=(--dry-run) | ||
| fi | ||
| if [[ "${CHECKSUMS:-true}" != "true" ]]; then | ||
| args+=(--no-checksums) | ||
| fi | ||
|
|
||
| ./.github/scripts/publish-to-s3/publish.sh "${args[@]}" | ||
| echo "::endgroup::" |
43 changes: 0 additions & 43 deletions
43
.github/actions/core-cicd/deployment/deploy-jfrog/README.md
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.