@@ -118,25 +118,11 @@ jobs:
118
118
name : python-wheels-${{ steps.set_version.outputs.version }}-${{ runner.os }}-${{ steps.get_arch.outputs.arch }}-py${{ matrix.python-version }}
119
119
path : SVF-Python/dist/
120
120
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
-
134
121
publish :
135
122
needs : build
136
123
runs-on : ubuntu-latest
137
- environment : pypi
138
124
permissions :
139
- id-token : write # allow to write to the repository
125
+ contents : write
140
126
141
127
steps :
142
128
- name : Checkout repository
@@ -148,15 +134,14 @@ jobs:
148
134
149
135
- name : Download all wheel artifacts
150
136
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/
153
144
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
160
145
env :
161
146
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
162
147
@@ -168,10 +153,13 @@ jobs:
168
153
exit 1
169
154
fi
170
155
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
172
164
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