diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59ae6297df..5e692eb8f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,8 +71,8 @@ jobs: run: | until .ci/release/wait_maven_artifact_published.sh ${{ inputs.version }} do - echo "Artifacts not found on maven central. Sleeping 10 seconds, retrying afterwards" - sleep 10s + echo "Artifacts not found on maven central. Sleeping 30 seconds, retrying afterwards" + sleep 30s done update_cloudfoundry: @@ -82,6 +82,8 @@ jobs: if: false steps: - uses: actions/checkout@v3 + with: + ref: main #TODO: Use apmmachine + setup authorization (SSH?) - name: Set up git user run: | @@ -96,12 +98,15 @@ jobs: build_docker_images: name: "Build and push docker images" runs-on: ubuntu-latest + #TODO: disabled for now + if: false env: TAG_NAME: v${{ inputs.version }} SONATYPE_FALLBACK: 1 steps: - uses: actions/checkout@v3 with: + ref: main fetch-depth: 0 # Load entire history as it is required for the push-script # TODO: docker login - name: "Build docker image" @@ -110,3 +115,62 @@ jobs: - name: "Tag and push docker images" shell: bash run: ./scripts/jenkins/push_docker.sh + + publish_aws_lambda: + name: "Publish AWS Lambda" + runs-on: ubuntu-latest + outputs: + arn_content: ${{ steps.arn_output.outputs.arn_content }} + steps: + - uses: actions/checkout@v3 + with: + ref: main + # TODO: actual lambda creation + upload + - name: Setup dummy ARN file + run: | + { + echo "### ARNs of the APM Java Agent's AWS Lambda Layer" + echo '' + echo '|Region|ARN|' + echo '|------|---|' + } > ".ci/arn-file.md" + - uses: actions/upload-artifact@v3 + with: + name: arn-file + path: .ci/arn-file.md + - name: Add ARN file to output + id: arn_output + run: | + echo 'arn_content<> $GITHUB_OUTPUT + cat .ci/arn-file.md >> $GITHUB_OUTPUT + echo 'ARN_CONTENT_EOF' >> $GITHUB_OUTPUT + + + create_github_release: + name: "Create GitHub Release" + needs: + - publish_aws_lambda + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: main + - name: Await release-notes published + shell: bash + run: | + until .ci/release/wait_release_notes_published.sh ${{ inputs.version }} + do + echo "Release notes not published yet. Sleeping 30 seconds, retrying afterwards" + sleep 30s + done + - name: Compute major.x branch + id: get_dotx_branch + run: echo "dotx_branch=$(echo '${{ inputs.version }}' | sed -E 's/\..+/.x/')" >> $GITHUB_OUTPUT + - uses: ncipollo/release-action@v1 + with: + #token: TODO: set apmmachine (or whoever releases) user token here! + tag: v${{ inputs.version }} + name: Release ${{ inputs.version }} + body: | + [Release Notes for ${{ inputs.version }}](https://www.elastic.co/guide/en/apm/agent/java/current/release-notes-${{ steps.get_dotx_branch.outputs.dotx_branch }}.html#release-notes-${{ inputs.version }}) + ${{ needs.publish_aws_lambda.outputs.arn_content }}