Skip to content

1.40.0

1.40.0 #10

name: Add release to Cloud Foundry
on:
release:
types:
- released
jobs:
update-releases:
permissions:
contents: write # Required to commit and push changes to the repository
runs-on: ubuntu-latest
steps:
- name: Checkout "cloudfoundry" branch
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # 4.1.6
with:
ref: cloudfoundry
- name: Get release version
id: get-release-version
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: echo "VERSION=$(echo ${TAG_NAME/#v/})" >> $GITHUB_OUTPUT
- name: Get release URL
id: get-release-url
run: |
echo "URL=https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${{ steps.get-release-version.outputs.VERSION }}/dd-java-agent-${{ steps.get-release-version.outputs.VERSION }}.jar" >> $GITHUB_OUTPUT
- name: Wait for the release to be available
run: |
TRY=0
MAX_TRIES=60 # Wait up to 30 minutes
DELAY=30
while [ $TRY -lt $MAX_TRIES ]; do
if curl -s -I ${{ steps.get-release-url.outputs.URL }} | grep -q "^HTTP/.* 200"; then
break
fi
echo "Waiting for the release to be available..."
sleep $DELAY
TRY=$((TRY+1))
if [ $TRY -eq $MAX_TRIES ]; then
echo "The release is not available after 30 mins. Aborting..."
exit 1
fi
done
- name: Append release to Cloud Foundry repository
run: |
echo "${{ steps.get-release-version.outputs.VERSION }}: ${{ steps.get-release-url.outputs.URL }}" >> index.yml
- name: Commit and push changes
uses: planetscale/ghcommit-action@b68767a2e130a71926b365322e62b583404a5e09 # v0.1.43
with:
commit_message: "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
repo: ${{ github.repository }}
branch: cloudfoundry
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}