Skip to content

Commit 4b604e8

Browse files
committed
ci: pass create-release upload_url via job outputs and update upload-release
1 parent 0dfdb7a commit 4b604e8

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

.github/workflows/release.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ jobs:
161161
runs-on: ubuntu-latest
162162
outputs:
163163
version: ${{ steps.package_version.outputs.version }}
164+
upload_url: ${{ steps.create-release.outputs.upload_url }}
164165
steps:
165166
- uses: actions/checkout@v1
166167

@@ -181,15 +182,7 @@ jobs:
181182
draft: true
182183
prerelease: false
183184

184-
- run: |
185-
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
186-
187-
- uses: actions/upload-artifact@v4
188-
with:
189-
name: create-release
190-
path: release_upload_url.txt
191-
if-no-files-found: warn
192-
overwrite: true
185+
# upload_url is exported as a job output and will be consumed by downstream jobs
193186

194187
upload-release:
195188
strategy:
@@ -223,14 +216,6 @@ jobs:
223216
needs: [create-release]
224217
runs-on: ubuntu-latest
225218
steps:
226-
- uses: actions/download-artifact@v4
227-
with:
228-
name: create-release
229-
230-
- id: upload-url
231-
run: |
232-
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
233-
234219
- uses: actions/download-artifact@v4
235220
with:
236221
name: build-${{ matrix.goos }}_${{ matrix.goarch }}
@@ -239,7 +224,7 @@ jobs:
239224
env:
240225
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241226
with:
242-
upload_url: ${{ steps.upload-url.outputs.url }}
227+
upload_url: ${{ needs.create-release.outputs.upload_url }}
243228
asset_path: ./build-${{ matrix.goos }}_${{ matrix.goarch }}/lssh_${{ needs.create-release.outputs.version }}_${{ matrix.goos }}_${{ matrix.goarch }}.${{ matrix.ext }}
244229
asset_name: lssh_${{ needs.create-release.outputs.version }}_${{ matrix.goos }}_${{ matrix.goarch }}.${{ matrix.ext }}
245230
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)