55 version :
66 description : The version to tag the release with, e.g., 1.2.0
77 required : true
8+ push :
89
910env :
1011 AWS_DEFAULT_REGION : us-east-1
@@ -37,88 +38,96 @@ jobs:
3738 package_name : aws-opentelemetry-distro
3839 os : ubuntu-latest
3940
40- # TODO: Add some sort of smoke/integration testing before we go
41- # release the artifacts. adot java for reference:
42- # https://github.com/aws-observability/aws-otel-java-instrumentation/tree/93870a550ac30988fbdd5d3bf1e8f9f1b37916f5/smoke-tests
41+ # # TODO: Add some sort of smoke/integration testing before we go
42+ # # release the artifacts. adot java for reference:
43+ # # https://github.com/aws-observability/aws-otel-java-instrumentation/tree/93870a550ac30988fbdd5d3bf1e8f9f1b37916f5/smoke-tests
4344
44- - name : Configure AWS credentials for PyPI secrets
45- uses : aws-actions/configure-aws-credentials@v4
46- with :
47- role-to-assume : ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
48- aws-region : ${{ env.AWS_DEFAULT_REGION }}
45+ # - name: Configure AWS credentials for PyPI secrets
46+ # uses: aws-actions/configure-aws-credentials@v4
47+ # with:
48+ # role-to-assume: ${{ secrets.AWS_ROLE_ARN_SECRETS_MANAGER }}
49+ # aws-region: ${{ env.AWS_DEFAULT_REGION }}
4950
50- - name : Get PyPI secrets
51- uses : aws-actions/aws-secretsmanager-get-secrets@v1
52- id : pypi_secrets
53- with :
54- secret-ids : |
55- PROD_PYPI_TOKEN,${{ secrets.PYPI_PROD_TOKEN_SECRET_ARN }}
56- TEST_PYPI_TOKEN,${{ secrets.PYPI_TEST_TOKEN_SECRET_ARN }}
57- parse-json-secrets : true
58-
59- - name : Configure AWS credentials for private ECR
60- uses : aws-actions/configure-aws-credentials@v4
61- with :
62- role-to-assume : ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }}
63- aws-region : ${{ env.AWS_PRIVATE_ECR_REGION }}
64-
65- - name : Log in to AWS private ECR
66- uses : docker/login-action@v3
67- with :
68- registry : ${{ env.RELEASE_PRIVATE_REGISTRY }}
69-
70- - name : Configure AWS credentials for public ECR
71- uses : aws-actions/configure-aws-credentials@v4
72- with :
73- role-to-assume : ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }}
74- aws-region : ${{ env.AWS_PUBLIC_ECR_REGION }}
75-
76- - name : Log in to AWS public ECR
77- uses : docker/login-action@v3
78- with :
79- registry : public.ecr.aws
80-
81- # The step below publishes to testpypi in order to catch any issues
82- # with the package configuration that would cause a failure to upload to pypi.
83- - name : Install twine
84- run : pip install twine
51+ # - name: Get PyPI secrets
52+ # uses: aws-actions/aws-secretsmanager-get-secrets@v1
53+ # id: pypi_secrets
54+ # with:
55+ # secret-ids: |
56+ # PROD_PYPI_TOKEN,${{ secrets.PYPI_PROD_TOKEN_SECRET_ARN }}
57+ # TEST_PYPI_TOKEN,${{ secrets.PYPI_TEST_TOKEN_SECRET_ARN }}
58+ # parse-json-secrets: true
59+
60+ # - name: Configure AWS credentials for private ECR
61+ # uses: aws-actions/configure-aws-credentials@v4
62+ # with:
63+ # role-to-assume: ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }}
64+ # aws-region: ${{ env.AWS_PRIVATE_ECR_REGION }}
65+
66+ # - name: Log in to AWS private ECR
67+ # uses: docker/login-action@v3
68+ # with:
69+ # registry: ${{ env.RELEASE_PRIVATE_REGISTRY }}
70+
71+ # - name: Configure AWS credentials for public ECR
72+ # uses: aws-actions/configure-aws-credentials@v4
73+ # with:
74+ # role-to-assume: ${{ secrets.AWS_ROLE_ARN_ECR_RELEASE }}
75+ # aws-region: ${{ env.AWS_PUBLIC_ECR_REGION }}
76+
77+ # - name: Log in to AWS public ECR
78+ # uses: docker/login-action@v3
79+ # with:
80+ # registry: public.ecr.aws
81+
82+ # # The step below publishes to testpypi in order to catch any issues
83+ # # with the package configuration that would cause a failure to upload to pypi.
84+ # - name: Install twine
85+ # run: pip install twine
8586
86- - name : Publish to TestPyPI
87- env :
88- TWINE_USERNAME : ' __token__'
89- TWINE_PASSWORD : ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
90- run : |
91- twine upload --repository testpypi --skip-existing --verbose dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
87+ # - name: Publish to TestPyPI
88+ # env:
89+ # TWINE_USERNAME: '__token__'
90+ # TWINE_PASSWORD: ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
91+ # run: |
92+ # twine upload --repository testpypi --skip-existing --verbose dist/aws_opentelemetry_distro-0.7.0.dev0-py3-none-any.whl
93+
94+ # # Publish to prod PyPI
95+ # - name: Publish to PyPI
96+ # env:
97+ # TWINE_USERNAME: '__token__'
98+ # TWINE_PASSWORD: ${{ env.PROD_PYPI_TOKEN_API_TOKEN }}
99+ # run: |
100+ # twine upload --skip-existing --verbose dist/aws_opentelemetry_distro-0.7.0.dev0-py3-none-any.whl
101+
102+ # # Publish to public ECR
103+ # - name: Build and push public ECR image
104+ # uses: docker/build-push-action@v5
105+ # with:
106+ # push: true
107+ # context: .
108+ # file: ./Dockerfile
109+ # platforms: linux/amd64,linux/arm64
110+ # tags: |
111+ # ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v0.7.0.dev0
112+
113+ # # Publish to private ECR
114+ # - name: Build and push private ECR image
115+ # uses: docker/build-push-action@v5
116+ # with:
117+ # push: true
118+ # context: .
119+ # file: ./Dockerfile
120+ # platforms: linux/amd64,linux/arm64
121+ # tags: |
122+ # ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v0.7.0.dev0
92123
93- # Publish to prod PyPI
94- - name : Publish to PyPI
124+ - name : Get SHA256 checksum of wheel file
125+ id : get_sha256
95126 env :
96- TWINE_USERNAME : ' __token__'
97- TWINE_PASSWORD : ${{ env.PROD_PYPI_TOKEN_API_TOKEN }}
127+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98128 run : |
99- twine upload --skip-existing --verbose dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
100-
101- # Publish to public ECR
102- - name : Build and push public ECR image
103- uses : docker/build-push-action@v5
104- with :
105- push : true
106- context : .
107- file : ./Dockerfile
108- platforms : linux/amd64,linux/arm64
109- tags : |
110- ${{ env.RELEASE_PUBLIC_REPOSITORY }}:v${{ github.event.inputs.version }}
111-
112- # Publish to private ECR
113- - name : Build and push private ECR image
114- uses : docker/build-push-action@v5
115- with :
116- push : true
117- context : .
118- file : ./Dockerfile
119- platforms : linux/amd64,linux/arm64
120- tags : |
121- ${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }}
129+ filename="aws_opentelemetry_distro-0.7.0.dev0-py3-none-any.whl"
130+ shasum -a 256 dist/$filename | awk '{print $1}' > $filename.sha256
122131
123132 # Publish to GitHub releases
124133 - name : Create GH release
@@ -127,31 +136,13 @@ jobs:
127136 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
128137 run : |
129138 gh release create --target "$GITHUB_REF_NAME" \
130- --title "Release v${{ github.event.inputs.version }} " \
139+ --title "Release v0.7.0.dev0 " \
131140 --draft \
132- "v${{ github.event.inputs.version }}" \
133- dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
141+ "v0.7.0.dev0" \
142+ dist/aws_opentelemetry_distro-0.7.0.dev0-py3-none-any.whl \
143+ aws_opentelemetry_distro-0.7.0.dev0-py3-none-any.whl.sha256
134144
135- - name : Get SHA256 checksum of wheel file
136- id : get_sha256
137- env :
138- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
139- run : |
140- checksum=$(shasum -a 256 dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl | awk '{ print $1 }')
141- echo "CHECKSUM=$checksum" >> $GITHUB_OUTPUT
142145
143- - name : Append checksum and update version
144- env :
145- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
146- run : |
147- echo "aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl ${{ steps.get_sha256.outputs.CHECKSUM }}" >> checksum.txt
148- echo "${{ github.event.inputs.version }}" > version.txt
149-
150- git config --local user.email "github-actions[bot]@users.noreply.github.com"
151- git config --local user.name "GitHub Action Release Workflow"
152- git add checksum.txt version.txt
153- git commit -m "Update latest version and append checksum"
154- git push
155146
156147
157148
0 commit comments