File tree Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Expand file tree Collapse file tree 1 file changed +41
-1
lines changed Original file line number Diff line number Diff line change 7
7
description : ' Version number for deployment e.g. 0.1.0'
8
8
required : true
9
9
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
10
17
11
18
jobs :
12
19
build-test-publish :
74
81
exit 1
75
82
fi
76
83
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
+ PROD_PYPI_TOKEN,${{ secrets.PYPI_PROD_TOKEN_SECRET_ARN }}
96
+ TEST_PYPI_TOKEN,${{ secrets.PYPI_TEST_TOKEN_SECRET_ARN }}
97
+ parse-json-secrets : true
98
+
99
+ - name : Install twine
100
+ run : pip install twine
101
+
102
+ # The step below publishes to testpypi in order to catch any issues
103
+ # with the package configuration that would cause a failure to upload to PyPI.
104
+ - name : Publish to TestPyPI
105
+ env :
106
+ TWINE_USERNAME : ' __token__'
107
+ TWINE_PASSWORD : ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
108
+ run : |
109
+ twine upload --repository testpypi --skip-existing --verbose exporters/aws-otel-otlp-udp-exporter/dist/${{ env.ARTIFACT_NAME }}
110
+
111
+ # Publish to prod PyPI
112
+ - name : Publish to PyPI
113
+ env :
114
+ TWINE_USERNAME : ' __token__'
115
+ TWINE_PASSWORD : ${{ env.PROD_PYPI_TOKEN_API_TOKEN }}
116
+ run : |
117
+ twine upload --skip-existing --verbose exporters/aws-otel-otlp-udp-exporter/dist/${{ env.ARTIFACT_NAME }}
You can’t perform that action at this time.
0 commit comments