-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*Issue #, if available:* *Description of changes:* Add the release workflow. The real publishing to ECR and npm is commented out. Test execution: https://github.com/aws-observability/aws-otel-js-instrumentation/actions/runs/10516163053/job/29139391410 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
- Loading branch information
Showing
2 changed files
with
109 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,108 @@ | ||
name: Release Build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to tag the release with, e.g., 1.2.0 | ||
required: true | ||
|
||
env: | ||
AWS_DEFAULT_REGION: us-east-1 | ||
AWS_PUBLIC_ECR_REGION: us-east-1 | ||
AWS_PRIVATE_ECR_REGION: us-west-2 | ||
RELEASE_PUBLIC_REPOSITORY: public.ecr.aws/aws-observability/adot-autoinstrumentation-node | ||
RELEASE_PRIVATE_REPOSITORY: 020628701572.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-node | ||
RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com | ||
PACKAGE_NAME: aws-distro-opentelemetry-node-autoinstrumentation | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
environment: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }} | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Tarball and Image Files | ||
uses: ./.github/actions/artifacts_build | ||
with: | ||
image_uri_with_tag: "adot-autoinstrumentation-node:test" | ||
push_image: false | ||
load_image: true | ||
node_version: "20" | ||
package_name: aws-distro-opentelemetry-node-autoinstrumentation | ||
os: ubuntu-latest | ||
|
||
# TODO: Add some sort of smoke/integration testing before we go | ||
# release the artifacts. adot java for reference: | ||
# https://github.com/aws-observability/aws-otel-java-instrumentation/tree/93870a550ac30988fbdd5d3bf1e8f9f1b37916f5/smoke-tests | ||
|
||
- name: Configure AWS credentials for private ECR | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }} | ||
aws-region: ${{ env.AWS_PRIVATE_ECR_REGION }} | ||
|
||
- name: Log in to AWS private ECR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.RELEASE_PRIVATE_REGISTRY }} | ||
|
||
- name: Configure AWS credentials for public ECR | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }} | ||
aws-region: ${{ env.AWS_PUBLIC_ECR_REGION }} | ||
|
||
- name: Log in to AWS public ECR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: public.ecr.aws | ||
|
||
|
||
# # Publish to public ECR | ||
# - name: Build and push public ECR image | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# push: true | ||
# context: . | ||
# file: ./Dockerfile | ||
# platforms: linux/amd64,linux/arm64 | ||
# tags: | | ||
# ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ github.event.inputs.version }} | ||
|
||
# # Publish to private ECR | ||
# - name: Build and push private ECR image | ||
# uses: docker/build-push-action@v5 | ||
# with: | ||
# push: true | ||
# context: . | ||
# file: ./Dockerfile | ||
# platforms: linux/amd64,linux/arm64 | ||
# tags: | | ||
# ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }} | ||
|
||
# # Publish to GitHub releases | ||
# - name: Create GH release | ||
# id: create_release | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
# run: | | ||
# gh release create --target "$GITHUB_REF_NAME" \ | ||
# --title "Release v${{ github.event.inputs.version }}" \ | ||
# --draft \ | ||
# "v${{ github.event.inputs.version }}" \ | ||
# aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz | ||
|
||
# Publish to npm | ||
# - name: Publish to npm | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
# NPM_CONFIG_PROVENANCE: true | ||
# run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes | ||
|
||
|
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