diff --git a/.github/workflows/release-lambda-init-containers.yml b/.github/workflows/release-lambda-init-containers.yml new file mode 100644 index 0000000000..5dfaa04090 --- /dev/null +++ b/.github/workflows/release-lambda-init-containers.yml @@ -0,0 +1,36 @@ +name: Agent Release Lambda Layers and K8s Init Containers + +on: + workflow_run: + workflows: ["Create Release"] + types: + - completed + +jobs: + release-tags: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: actions/setup-node@v4 + with: + node-version: 'lts/*' + - run: npm install + - run: | + git config user.name ${GITHUB_ACTOR} + git config user.email gh-actions-${GITHUB_ACTOR}@github.com + - id: get_tag + run: echo "latest_tag=$(cat package.json | jq .version)" >> $GITHUB_OUTPUT + - name: Create release tags for Lambda and K8s Init Containers + run: | + RELEASE_TITLE="New Relic Node Agent v${{ steps.get_tag.outputs.latest_tag }}.0" + RELEASE_TAG="v${{ steps.get_tag.outputs.latest_tag }}.0_nodejs" + RELEASE_NOTES="Automated release for [Node Agent v${{ steps.get_tag.outputs.latest_tag }}](https://github.com/newrelic/node-newrelic/releases/tag/v${{ steps.get_tag.outputs.latest_tag }})" + 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}" + env: + GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}