-
Notifications
You must be signed in to change notification settings - Fork 1
Share download-hz-dist action between hazelcast-docker and hazelcast-packaging [DI-525][DI-526]
#22
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
6 commits
Select commit
Hold shift + click to select a range
9ff7004
Share `download-hz-dist` action between `hazelcast-docker` and `hazel…
JackPGreen 904abc7
Update download-hz-dist/action.yml
JackPGreen b1e52f8
https://github.com/hazelcast/docker-actions/pull/22#discussion_r24549…
JackPGreen 40943d0
https://github.com/hazelcast/docker-actions/pull/22#discussion_r24553…
JackPGreen af136ca
https://github.com/hazelcast/docker-actions/pull/22#discussion_r24653…
JackPGreen bb04e11
https://github.com/hazelcast/docker-actions/pull/22#discussion_r24484…
JackPGreen 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,33 @@ | ||
| name: Test download-hz-dist action | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| distribution: | ||
| - hazelcast | ||
| - hazelcast-enterprise | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Download ${{ matrix.distribution }}" | ||
| uses: ./download-hz-dist | ||
| id: download | ||
| with: | ||
| repo-vars-as-json: "{\n \"MAVEN_EE_RELEASE_REPO\": \"https://repository.hazelcast.com/release\",\n \"MAVEN_OSS_RELEASE_REPO\": \" \"\n}" | ||
| distribution: "${{ matrix.distribution }}" | ||
| hz_version: "5.0" | ||
| classifier: "slim" | ||
| packaging: "tar.gz" | ||
|
|
||
| - name: Check file exists | ||
| run: | | ||
| if [[ ! -f "${{ steps.download.outputs.output_file }}" ]]; then | ||
| echo "${{ steps.download.outputs.output_file }} not found!" | ||
| exit 1 | ||
| fi | ||
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,79 @@ | ||
| name: Download Hazelcast Distribution | ||
| inputs: | ||
| repo-vars-as-json: | ||
| description: 'Repo Vars as JSON - not inherited in composite actions - see https://github.com/orgs/community/discussions/49689#discussioncomment-6398261' | ||
| required: true | ||
| distribution: | ||
| description: 'Distribution type: "hazelcast" or "hazelcast-enterprise"' | ||
| required: true | ||
| hz_version: | ||
| description: 'Hazelcast version' | ||
| required: true | ||
| classifier: | ||
| description: 'Maven classifier' | ||
| required: false | ||
| packaging: | ||
| description: 'Maven packaging' | ||
| required: true | ||
| output_file: | ||
JackPGreen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description: 'Path to the output file' | ||
| required: false | ||
| outputs: | ||
| maven_repo_url: | ||
| description: 'The Maven repository root URL used to download the distribution' | ||
| value: ${{ steps.get_repo_url.outputs.repo_url }} | ||
| output_file: | ||
| description: 'Path to the downloaded file' | ||
| value: ${{ steps.derive-output-file.outputs.file }} | ||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Get repository URL | ||
| id: get_repo_url | ||
| shell: bash | ||
| run: | | ||
| # Pick an appropriate key from "repo-vars-as-json" | ||
| case "${{ inputs.distribution }}" in | ||
| "hazelcast") | ||
| if [[ "${{ inputs.hz_version }}" == *"SNAPSHOT"* ]]; then | ||
| repo_var_name=MAVEN_OSS_SNAPSHOT_REPO | ||
| else | ||
| repo_var_name=MAVEN_OSS_RELEASE_REPO | ||
| fi | ||
| ;; | ||
| "hazelcast-enterprise") | ||
| if [[ "${{ inputs.hz_version }}" == *"SNAPSHOT"* ]]; then | ||
| repo_var_name=MAVEN_EE_SNAPSHOT_REPO | ||
| else | ||
| repo_var_name=MAVEN_EE_RELEASE_REPO | ||
| fi | ||
| ;; | ||
| *) | ||
| echoerr "Unsupported distribution type '${{ inputs.distribution }}'" ; return 1 | ||
| ;; | ||
| esac | ||
|
|
||
| # Lookup up the value of the selected key in "repo-vars-as-json" | ||
| echo "repo_url=$(jq --raw-output .${repo_var_name} <<< '${{ inputs.repo-vars-as-json }}')" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Derive output file | ||
| id: derive-output-file | ||
| shell: bash | ||
| run: | | ||
| echo "file=${{ inputs.output_file || format('distribution.{0}', inputs.packaging) }}" >> ${GITHUB_OUTPUT} | ||
|
|
||
| - name: Download via Maven | ||
| shell: bash | ||
| run: | | ||
| mvn \ | ||
| org.apache.maven.plugins:maven-dependency-plugin:2.10:get \ | ||
nishaatr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| -DremoteRepositories="${{ steps.get_repo_url.outputs.repo_url }}" \ | ||
| -DgroupId="com.hazelcast" \ | ||
| -DartifactId="${{ inputs.distribution }}-distribution" \ | ||
| -Dversion="${{ inputs.hz_version }}" \ | ||
| -Dclassifier="${{ inputs.classifier }}" \ | ||
| -Dpackaging="${{ inputs.packaging }}" \ | ||
| -Dtransitive=false \ | ||
| -Ddest="${{ steps.derive-output-file.outputs.file }}" \ | ||
| --batch-mode \ | ||
| --no-transfer-progress | ||
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.