Skip to content

update release workflow #38

update release workflow

update release workflow #38

name: Release ADOT OTLP UDP Exporter
on:
push:
branches:
- "rename-udp-exporter"
workflow_dispatch:
inputs:
version:
description: 'Version number for deployment e.g. 0.1.0'
required: true
type: string
env:
AWS_DEFAULT_REGION: us-east-1
ARTIFACT_NAME: aws_distro_otel_otlp_udp_exporter-${{ github.event.inputs.version }}-py3-none-any.whl
permissions:
id-token: write
contents: write
jobs:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch pytest flask
- name: Build package
working-directory: exporters/aws-distro-otel-otlp-udp-exporter
run: hatch build
- name: Download and run X-Ray Daemon
run: |
mkdir xray-daemon
cd xray-daemon
wget https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
unzip aws-xray-daemon-linux-3.x.zip
./xray -o -n us-west-2 -f ./daemon-logs.log --log-level debug &
- name: Install UDP Exporter
run: |
pip install ./exporters/aws-distro-otel-otlp-udp-exporter/dist/*.whl
- name: Ensure Unit Tests are passing
run: |
pytest exporters/aws-distro-otel-otlp-udp-exporter/tests/
- name: Run Sample App in Background
working-directory: sample-applications/integ-test-app
run: |
# Start validation app
python udp_exporter_validation_app.py &
# Wait for validation app to initialize
sleep 5
- name: Call Sample App Endpoint
run: |
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
- name: Verify X-Ray daemon received traces
run: |
sleep 10
echo "X-Ray daemon logs:"
cat xray-daemon/daemon-logs.log
# Check if the daemon received and processed some data
if grep -q "sending.*batch" xray-daemon/daemon-logs.log; then
echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"
exit 0
elif grep -q "processor:.*segment" xray-daemon/daemon-logs.log; then
echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"
exit 0
else
echo "❌ No evidence of traces being received by X-Ray daemon"
exit 1
fi
- name: Configure AWS credentials for PyPI secrets
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Get PyPI secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v1
id: pypi_secrets
with:
secret-ids: |
PROD_PYPI_TOKEN,${{ secrets.PYPI_PROD_TOKEN_SECRET_ARN }}
TEST_PYPI_TOKEN,${{ secrets.PYPI_TEST_TOKEN_SECRET_ARN }}
parse-json-secrets: true
- name: Install twine
run: pip install twine
# The step below publishes to testpypi in order to catch any issues
# with the package configuration that would cause a failure to upload to PyPI.
- name: Publish to TestPyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
run: |
twine upload --repository testpypi --skip-existing --verbose exporters/aws-distro-otel-otlp-udp-exporter/dist/${{ env.ARTIFACT_NAME }}
#
# # Publish to prod PyPI
# - name: Publish to PyPI
# env:
# TWINE_USERNAME: '__token__'
# TWINE_PASSWORD: ${{ env.PROD_PYPI_TOKEN_API_TOKEN }}
# run: |
# twine upload --skip-existing --verbose exporters/aws-distro-otel-otlp-udp-exporter/dist/${{ env.ARTIFACT_NAME }}