@@ -20,32 +20,19 @@ jobs:
2020 - test
2121 - packages
2222 runs-on : ubuntu-latest
23- env :
24- PYPI_SECRET_PATH : secret/apm-team/ci/apm-agent-python-pypi-prod
23+ environment : release
24+ permissions :
25+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
2526 steps :
2627 - uses : actions/checkout@v3
27- -
uses :
hashicorp/[email protected] 28- with :
29- url : ${{ secrets.VAULT_ADDR }}
30- method : approle
31- roleId : ${{ secrets.VAULT_ROLE_ID }}
32- secretId : ${{ secrets.VAULT_SECRET_ID }}
33- secrets : |
34- ${{ env.PYPI_SECRET_PATH }} user | TWINE_USER ;
35- ${{ env.PYPI_SECRET_PATH }} password | TWINE_PASSWORD
3628 - uses : actions/download-artifact@v3
3729 with :
3830 name : packages
3931 path : dist
4032 - name : Upload
41- run : |
42- python -m pip install --user twine
43- python setup.py sdist
44- echo "Uploading to ${REPO_URL} with user ${TWINE_USER}"
45- python -m twine upload --username "${TWINE_USER}" --password "${TWINE_PASSWORD}" --skip-existing --repository-url ${REPO_URL} dist/*.tar.gz
46- python -m twine upload --username "${TWINE_USER}" --password "${TWINE_PASSWORD}" --skip-existing --repository-url ${REPO_URL} dist/*.whl
47- env :
48- REPO_URL : " https://upload.pypi.org/legacy/"
33+ uses : pypa/gh-action-pypi-publish@f5622bde02b04381239da3573277701ceca8f6a0
34+ with :
35+ repository-url : https://upload.pypi.org/legacy/
4936
5037 build-distribution :
5138 uses : ./.github/workflows/build-distribution.yml
5643 runs-on : ubuntu-latest
5744 steps :
5845 - uses : actions/checkout@v3
59- - uses : hashicorp/vault-action@v2.5.0
46+ - uses : hashicorp/vault-action@v2.7.2
6047 with :
6148 url : ${{ secrets.VAULT_ADDR }}
6249 method : approle
7461 # Convert v1.2.3 to ver-1-2-3
7562 VERSION=${GITHUB_REF_NAME/v/ver-}
7663 VERSION=${VERSION//./-}
77-
64+
7865 ELASTIC_LAYER_NAME="elastic-apm-python-${VERSION}" .ci/publish-aws.sh
7966 - uses : actions/upload-artifact@v3
8067 with :
@@ -113,7 +100,7 @@ jobs:
113100 .
114101 - name : Docker retag
115102 run : >-
116- docker tag
103+ docker tag
117104 ${{ steps.setup-docker.outputs.name }}:${{ steps.setup-docker.outputs.tag }}
118105 ${{ steps.setup-docker.outputs.name }}:latest
119106 - name : Docker push
@@ -133,7 +120,7 @@ jobs:
133120 with :
134121 name : arn-file
135122 - name : Create GitHub Draft Release
136- run : >-
123+ run : >-
137124 gh release create "${GITHUB_REF_NAME}"
138125 --title="${GITHUB_REF_NAME}"
139126 --generate-notes
0 commit comments