forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Automation - Release OLTP components | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
inputs: | ||
candidate-version: | ||
required: true | ||
description: Release candidate version (beta, like 0.70.0) | ||
|
||
jobs: | ||
prepare-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: opentelemetry-collector-contrib | ||
ref: aws-ocb-dev | ||
- name: get hash | ||
working-directory: opentelemetry-collector-contrib | ||
run: | | ||
RELEASE_HASH=$(git rev-parse HEAD) | ||
echo RELEASE_HASH="$RELEASE_HASH" >> $GITHUB_ENV | ||
echo "$RELEASE_HASH" | ||
- name: build OCB | ||
run: | | ||
echo "hi" | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.ECR_ACCOUNT_ROLE_ARN }} | ||
aws-region: us-east-1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to private AWS ECR | ||
if: ${{ inputs.push_image == true || inputs.push_image == 'true' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ inputs.image_registry }} | ||
env: | ||
AWS_REGION: us-east-1 | ||
|
||
# Per https://docs.aws.amazon.com/AmazonECR/latest/public/docker-pull-ecr-image.html, it is possible to | ||
# make unauthorized calls to get public ECR images (needed to build the ADOT Node docker image), but | ||
# it can fail if you previously authenticated to a public repo. Adding this step to log out, so we | ||
# ensure we can make unauthenticated call. This is important for making the pr_build workflow run on | ||
# PRs created from forked repos. | ||
- name: Logout of public AWS ECR | ||
shell: bash | ||
run: docker logout public.ecr.aws | ||
|
||
- name: Build and push image according to input | ||
working-directory: opentelemetry-collector-contrib/.github/workflows/ocb-utils/ | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
tags: ${{ secrets.ECR_REPO }}:${{ env.RELEASE_HASH }} | ||
load: false | ||
|
||
# - name: trigger test in other repo | ||
# run: | | ||
# echo "hi" | ||
|
||
# - name: if test passed, create tags PR | ||
# run: | | ||
# echo "hi" | ||
|
||
# - name: if test passed, upload OCB to staging repo with latest as tag | ||
# run: | | ||
# echo "hi" |