Skip to content

Commit

Permalink
Added GH release step
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKunz committed Feb 10, 2023
1 parent f2f66d5 commit f5da4c3
Showing 1 changed file with 66 additions and 2 deletions.
68 changes: 66 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand All @@ -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"
Expand All @@ -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<<ARN_CONTENT_EOF' >> $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 }}

0 comments on commit f5da4c3

Please sign in to comment.