Skip to content

Expose option to download latest development release in the download actions #676

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 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/actions/gradle/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
token:
description: "GitHub token"
required: false
downloadDevelopmentRelease:
description: "Downloads the latest development version when 'true'; by default, the latest released version is downloaded"
default: "false"
required: false

runs:
using: "composite"
Expand All @@ -19,12 +23,17 @@ runs:
curlOpts+=(--header 'Authorization: Bearer ${{ inputs.token }}')
fi

# Get the download url of the latest release
downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-gradle)
releaseUrl="https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest"
if [ "${{ inputs.downloadDevelopmentRelease }}" == "true" ]; then
releaseUrl="https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/tags/development-latest"
fi

# Get the download url of the latest development or released version
downloadUrl=$(curl "${curlOpts[@]}" "$releaseUrl" | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-gradle)

# Download the latest version of the build validation scripts
# Download the scripts
curl "${curlOpts[@]}" --output develocity-gradle-build-validation.zip $downloadUrl

# Unzip the downloaded build validation scripts
# Unzip the downloaded scripts
unzip -q -o develocity-gradle-build-validation.zip
shell: bash
17 changes: 13 additions & 4 deletions .github/actions/maven/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
token:
description: "GitHub token"
required: false
downloadDevelopmentRelease:
description: "Downloads the latest development version when 'true'; by default, the latest released version is downloaded"
default: "false"
required: false

runs:
using: "composite"
Expand All @@ -19,12 +23,17 @@ runs:
curlOpts+=(--header 'Authorization: Bearer ${{ inputs.token }}')
fi

# Get the download url of the latest release
downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-maven)
releaseUrl="https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest"
if [ "${{ inputs.downloadDevelopmentRelease }}" == "true" ]; then
releaseUrl="https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/tags/development-latest"
fi

# Get the download url of the latest development or released version
downloadUrl=$(curl "${curlOpts[@]}" "$releaseUrl" | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-maven)

# Download the latest version of the build validation scripts
# Download the scripts
curl "${curlOpts[@]}" --output develocity-maven-build-validation.zip $downloadUrl

# Unzip the downloaded build validation scripts
# Unzip the downloaded scripts
unzip -q -o develocity-maven-build-validation.zip
shell: bash