@@ -17,15 +17,15 @@ jobs:
1717 name : Build package
1818 runs-on : ubuntu-latest
1919 steps :
20- - uses : actions/checkout@v4
20+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
2222 - name : Setup Python
23- uses : actions/setup-python@v5
23+ uses : actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2424 with :
2525 python-version : ${{ env.MAIN_PYTHON_VERSION }}
2626
2727 - name : Run protolint
28- uses : plexsystems/protolint-action@v0.7.0
28+ uses : plexsystems/protolint-action@7838989df3edefc91ea9370aadd5225e6bb73836 # v0.7.0
2929 with :
3030 configDirectory : .
3131
@@ -48,14 +48,14 @@ jobs:
4848 python -c "from ansys.api.geometry import __version__; print(__version__)"
4949
5050 - name : Upload packages
51- uses : actions/upload-artifact@v4
51+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5252 with :
5353 name : ansys-api-geometry-artifacts
5454 path : dist/
5555 retention-days : 7
5656
5757 release :
58- name : Release package
58+ name : Release package to GitHub
5959 if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
6060 needs : [build]
6161 runs-on : ubuntu-latest
@@ -65,17 +65,41 @@ jobs:
6565 id-token : write
6666 contents : write
6767 steps :
68- - name : Release to the public PyPI repository
69- uses : ansys/ actions/release-pypi-public@v8
68+ - name : " Download the library artifacts from build-library step "
69+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
7070 with :
71- library- name : " ansys-api-geometry"
72- use-trusted-publisher : true
71+ name : ansys-api-geometry-artifacts
72+ path : ansys-api-geometry-artifacts
7373
7474 - name : Release
75- uses : softprops/action-gh-release@v2
75+ uses : softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
7676 with :
7777 generate_release_notes : true
7878 files : |
7979 ./**/*.whl
8080 ./**/*.tar.gz
81- ./**/*.pdf
81+
82+ release-pypi :
83+ name : Release project to PyPI
84+ if : github.event_name == 'push' && contains(github.ref, 'refs/tags')
85+ needs : [build]
86+ runs-on : ubuntu-latest
87+ # Specifying a GitHub environment is optional, but strongly encouraged
88+ environment : release
89+ permissions :
90+ id-token : write
91+ contents : write
92+ steps :
93+ - name : " Download the library artifacts from build-library step"
94+ uses : actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
95+ with :
96+ name : ansys-api-geometry-artifacts
97+ path : ansys-api-geometry-artifacts
98+
99+ - name : " Upload artifacts to PyPI using trusted publisher"
100+ uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
101+ with :
102+ repository-url : " https://upload.pypi.org/legacy/"
103+ print-hash : true
104+ packages-dir : ansys-api-geometry-artifacts
105+ skip-existing : false
0 commit comments