Skip to content

Release ADOT X-Ray UDP Exporter #2

Release ADOT X-Ray UDP Exporter

Release ADOT X-Ray UDP Exporter #2

name: Release ADOT X-Ray UDP Exporter
on:
workflow_dispatch:
inputs:
udp-exporter-version:
description: The version to tag the release with, e.g., 1.2.0
required: true
type: string
permissions:
id-token: write
contents: write
jobs:
validate-udp-exporter-e2e-test:
name: "Validate X-Ray UDP Exporter E2E Test Succeeds"
uses: ./.github/workflows/udp-exporter-e2e-test.yml
secrets: inherit
permissions:
id-token: write
build:
environment: Release
runs-on: ubuntu-latest
needs: validate-udp-exporter-e2e-test
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- name: Set up Node and run Unit Tests
uses: ./.github/actions/set_up
with:
node_version: "20"
package_name: "@aws/aws-distro-opentelemetry-exporter-xray-udp"
os: ubuntu-latest
run_unit_tests: true
# Project dependencies and compilation are already done in the previous step
- name: Install Dependencies, Compile, and Build Tarball
id: staging_tarball_build
shell: bash
run: |
cd exporters/aws-distro-opentelemetry-exporter-xray-udp
npm pack
- name: Validate project version matches workflow input
run: |
xrayUdpSpanExporterVersion=$(node -p "require('./exporters/aws-distro-opentelemetry-exporter-xray-udp/package.json').version")
if [[ ! "$xrayUdpSpanExporterVersion" == "${{ inputs.udp-exporter-version }}" ]]; then
echo "Input version '${{ inputs.udp-exporter-version }}' does not match with the UDP Exporter project version '$xrayUdpSpanExporterVersion'"
exit 1
fi
# Publish X-Ray UDP Exporter to npm
- name: Publish to npm
working-directory: exporters/aws-distro-opentelemetry-exporter-xray-udp
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
run: npm publish
# 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 aws-distro-opentelemetry-exporter-xray-udp v${{ inputs.udp-exporter-version }}" \
--notes "Please refer to the [Changelog](https://github.com/aws-observability/aws-otel-js-instrumentation/blob/main/exporters/aws-distro-opentelemetry-exporter-xray-udp/CHANGELOG.md) for more details" \
--draft \
"aws-distro-opentelemetry-exporter-xray-udp/v${{ inputs.udp-exporter-version }}"