Skip to content

Commit 82a510f

Browse files
committed
automate uploading of release assets
1 parent 68d548e commit 82a510f

File tree

2 files changed

+379
-369
lines changed

2 files changed

+379
-369
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
runs-on: ubuntu-latest
154154
environment: publish
155155
needs: package
156-
if: success() && startsWith( github.ref, 'refs/tags/v')
156+
if: success() && startsWith( github.ref, 'refs/tags')
157157
steps:
158158
- uses: actions/checkout@v2
159159
with:
@@ -207,9 +207,12 @@ jobs:
207207

208208
- name: find vsix
209209
id: find_vsix
210-
run: echo "::set-output name=vsix::$(find dist -iname '*.vsix')"
210+
run: |
211+
echo "::set-output name=vsix_file::$(find dist -iname '*.vsix')"
212+
echo "::set-output name=vsix_name::$(find dist -iname '*.vsix' -printf '%f\n')"
211213
212-
- name: Create Release
214+
215+
- name: create release
213216
id: create_release
214217
uses: actions/create-release@v1
215218
env:
@@ -221,13 +224,13 @@ jobs:
221224
draft: true
222225
prerelease: true
223226

224-
- name: Upload Release Asset
227+
- name: upload release vsix
225228
id: upload-release-asset
226229
uses: actions/upload-release-asset@v1
227230
env:
228231
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229232
with:
230233
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
231-
asset_path: ${{ steps.create_release.outputs.vsix }}
232-
asset_name: robotcode.vsix
234+
asset_path: ${{ steps.find_vsix.outputs.vsix_file }}
235+
asset_name: ${{ steps.find_vsix.outputs.vsix_name }}
233236
asset_content_type: application/vsix

0 commit comments

Comments
 (0)