Skip to content

Commit

Permalink
Merge pull request #7161 from DataDog/bbujon/ci-cloudfoundry
Browse files Browse the repository at this point in the history
Add Cloud Foundry release automation
  • Loading branch information
PerfectSlayer committed Jun 11, 2024
2 parents 617453e + d4bc4fe commit 42276d7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ _Action:_ Get the last (by name) opened milestone and affect it to the closed pu

_Recovery:_ Attach the milestone by hand to the PR.

### add-release-to-cloudfoundry [🔗](add-release-to-cloudfoundry.yaml)

_Trigger:_ When a release is published.

_Action:_ Append the new release to the Cloud Foundry repository.

_Recovery:_ Manually edit and push the `index.yml` file from [the cloudfoundry branch](https://github.com/DataDog/dd-trace-java/tree/cloudfoundry).

### create-next-milestone [🔗](create-next-milestone.yaml)

_Trigger:_ When closing a milestone.
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/add-release-to-cloudfoundry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Add release to Cloud Foundry
on:
release:
types:
- released
jobs:
update-releases:
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: Append release to Cloud Foundry repository
env:
VERSION: ${{ steps.get-release-version.outputs.VERSION }}
run: |
git checkout -b ci/cloudfoundry
echo "${VERSION}: https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar" >> index.yml
git add index.yml
git commit -m "chore: Add version ${VERSION} to Cloud Foundry"
git push -u origin ci/cloudfoundry
gh pr create --title "Add version ${VERSION} to Cloud Foundry" --body "This PR add the version ${VERSION} to Cloud Foundry. Make sure [the JAR is online](https://repo1.maven.org/maven2/com/datadoghq/dd-java-agent/${VERSION}/dd-java-agent-${VERSION}.jar) before merging." --base cloudfoundry

0 comments on commit 42276d7

Please sign in to comment.