@@ -118,25 +118,11 @@ jobs:
118118 name : python-wheels-${{ steps.set_version.outputs.version }}-${{ runner.os }}-${{ steps.get_arch.outputs.arch }}-py${{ matrix.python-version }}
119119 path : SVF-Python/dist/
120120
121- - name : Collect artifact names
122- id : collect_artifacts
123- run : |
124- old_value="${{ steps.collect_artifacts.outputs.artifacts }}"
125- new_artifact="python-wheels-${{ steps.set_version.outputs.version }}-${{ runner.os }}-${{ steps.get_arch.outputs.arch }}-py${{ matrix.python-version }}"
126-
127- if [ -n "$old_value" ]; then
128- echo "artifacts=$old_value,$new_artifact" >> $GITHUB_OUTPUT
129- else
130- echo "artifacts=$new_artifact" >> $GITHUB_OUTPUT
131- fi
132-
133-
134121 publish :
135122 needs : build
136123 runs-on : ubuntu-latest
137- environment : pypi
138124 permissions :
139- id-token : write # allow to write to the repository
125+ contents : write
140126
141127 steps :
142128 - name : Checkout repository
@@ -148,15 +134,14 @@ jobs:
148134
149135 - name : Download all wheel artifacts
150136 run : |
151- artifacts="${{ needs.build.outputs.artifacts }}"
152- IFS=',' read -ra artifact_list <<< "$artifacts"
137+ mkdir -p dist/
138+
139+ # get cur run id
140+ RUN_ID=$(gh run list --workflow svf-python-build.yml --branch main --limit 1 --json databaseId --jq '.[0].databaseId')
141+
142+ # download all artifacts from the latest run
143+ gh run download $RUN_ID --dir dist/
153144
154- for artifact in "${artifact_list[@]}"; do
155- if [ -n "$artifact" ]; then
156- echo "Downloading artifact: $artifact"
157- gh run download --name "$artifact" --dir dist/
158- fi
159- done
160145 env :
161146 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
162147
@@ -168,10 +153,13 @@ jobs:
168153 exit 1
169154 fi
170155
171- - name : Publish to TestPyPI
156+ - name : Create GitHub Release (latest)
157+ uses : softprops/action-gh-release@v1
158+ with :
159+ tag_name : latest
160+ release_name : " Development Build - latest"
161+ prerelease : true
162+ files : dist/*
163+ overwrite : true
172164 env :
173- TWINE_USERNAME : __token__
174- TWINE_PASSWORD : ${{ secrets.TEST_PYPI_API_TOKEN }}
175- run : |
176- pip install twine
177- twine upload --repository testpypi dist/* --verbose
165+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments