Skip to content

Commit 840acd7

Browse files
committed
test publish to testpypi
1 parent 79049d8 commit 840acd7

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/release-udp-exporter.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ on:
77
description: 'Version number for deployment e.g. 0.1.0'
88
required: true
99
type: string
10+
env:
11+
AWS_DEFAULT_REGION: us-east-1
12+
ARTIFACT_NAME: aws_otel_otlp_udp_exporter-${{ github.event.inputs.version }}-py3-none-any.whl
13+
14+
permissions:
15+
id-token: write
16+
contents: write
1017

1118
jobs:
1219
build-test-publish:
@@ -74,4 +81,28 @@ jobs:
7481
exit 1
7582
fi
7683
77-
# TODO: Steps to publish to PyPI
84+
- name: Configure AWS credentials for PyPI secrets
85+
uses: aws-actions/configure-aws-credentials@v4
86+
with:
87+
role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
88+
aws-region: ${{ env.AWS_DEFAULT_REGION }}
89+
90+
- name: Get PyPI secrets
91+
uses: aws-actions/aws-secretsmanager-get-secrets@v1
92+
id: pypi_secrets
93+
with:
94+
secret-ids: |
95+
TEST_PYPI_TOKEN,${{ secrets.PYPI_TEST_TOKEN_SECRET_ARN }}
96+
parse-json-secrets: true
97+
98+
- name: Install twine
99+
run: pip install twine
100+
101+
# The step below publishes to testpypi in order to catch any issues
102+
# with the package configuration that would cause a failure to upload to PyPI.
103+
- name: Publish to TestPyPI
104+
env:
105+
TWINE_USERNAME: '__token__'
106+
TWINE_PASSWORD: ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
107+
run: |
108+
twine upload --repository testpypi --skip-existing --verbose exporters/aws-otel-otlp-udp-exporter/dist/${{ env.ARTIFACT_NAME }}

exporters/aws-otel-otlp-udp-exporter/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "aws-otel-otlp-udp-exporter"
7-
version = "0.1.0"
7+
version = "0.0.1"
88
description = "OTLP UDP Exporter for OpenTelemetry"
99
readme = "README.rst"
1010
license = "Apache-2.0"

0 commit comments

Comments
 (0)