Skip to content
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

Add auto-layer-releases flow to deploy flow #1274

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .github/workflows/deploy-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,13 @@ jobs:
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}

- name: Create release tags for Lambda and K8s Init Containers
run: |
gh auth login --with-token <<< $GH_RELEASE_TOKEN
echo "newrelic/newrelic-lambda-layers - Releasing New Relic Python Agent ${GITHUB_REF}.0 with tag ${GITHUB_REF}.0_python"
gh create release "${GITHUB_REF}.0_python" -t "New Relic Python Agent ${GITHUB_REF}.0" --repo=newrelic/newrelic-lambda-layers
echo "newrelic/newrelic-agent-init-container - Releasing New Relic Python Agent ${GITHUB_REF}.0 with tag ${GITHUB_REF}.0_python"
gh create release "${GITHUB_REF}.0_python" -t "New Relic Python Agent ${GITHUB_REF}.0" --repo=newrelic/newrelic-agent-init-container
Comment on lines +186 to +192
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Create release tags for Lambda and K8s Init Containers
run: |
gh auth login --with-token <<< $GH_RELEASE_TOKEN
echo "newrelic/newrelic-lambda-layers - Releasing New Relic Python Agent ${GITHUB_REF}.0 with tag ${GITHUB_REF}.0_python"
gh create release "${GITHUB_REF}.0_python" -t "New Relic Python Agent ${GITHUB_REF}.0" --repo=newrelic/newrelic-lambda-layers
echo "newrelic/newrelic-agent-init-container - Releasing New Relic Python Agent ${GITHUB_REF}.0 with tag ${GITHUB_REF}.0_python"
gh create release "${GITHUB_REF}.0_python" -t "New Relic Python Agent ${GITHUB_REF}.0" --repo=newrelic/newrelic-agent-init-container
- name: Create release tags for Lambda and K8s Init Containers
run: |
RELEASE_TITLE="New Relic Python Agent ${GITHUB_REF}.0"
RELEASE_TAG="${GITHUB_REF}.0_python"
RELEASE_NOTES="Automated release for [Python Agent ${GITHUB_REF}](https://github.com/newrelic/newrelic-python-agent/releases/tag/${GITHUB_REF})"
gh auth login --with-token <<< $GH_RELEASE_TOKEN
echo "newrelic/newrelic-lambda-layers - Releasing ${RELEASE_TITLE} with tag ${RELEASE_TAG}"
gh release create "${RELEASE_TAG}" --title=${RELEASE_TITLE} --repo=newrelic/newrelic-lambda-layers --notes=${RELEASE_NOTES}
echo "newrelic/newrelic-agent-init-container - Releasing ${RELEASE_TITLE} with tag ${RELEASE_TAG}"
gh release create "${RELEASE_TAG}" --title=${RELEASE_TITLE} --repo=newrelic/newrelic-agent-init-container --notes=${RELEASE_NOTES}

I have 3 suggestions here, going to lump them together but if you don't like one of them I can separate it.

  1. You have the subcommands backwards: gh create release -> gh release create
  2. To make this slightly more DRY so it's easier to update for other agents, can we maybe pull these repeated expressions out into constants that are created once and then referenced?
  3. This would be a good opportunity to fix a random issue that annoys me, the release notes that are autogenerated by Github when none are supplied just ends up being the last commit message, which looks really strange and confusing when they have nothing to do with the agent being released. Can we provide a simple release note that just redirects to the original agent release on Github? That way it will always point to both the ref on Github and the actual release notes from that release are either there or linked on our docs site.

env:
GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}
Loading