Skip to content

Commit 51b4cae

Browse files
committed
automate creating github release for a new version tag
1 parent 2ae20b8 commit 51b4cae

File tree

6 files changed

+472
-367
lines changed

6 files changed

+472
-367
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ jobs:
153153
runs-on: ubuntu-latest
154154
environment: publish
155155
needs: package
156-
#if: success() && startsWith( github.ref, 'refs/tags/v')
157-
if: success()
156+
if: success() && startsWith( github.ref, 'refs/tags/v')
158157
steps:
159158
- uses: actions/checkout@v2
160159
with:
@@ -198,4 +197,37 @@ jobs:
198197
run: poetry run npm-publish
199198
env:
200199
VSCE_PAT: ${{ secrets.VSCE_PAT }}
200+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
201+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
202+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
201203

204+
- name: get release notes
205+
id: get_release_notes
206+
run: echo "::set-output name=release_notes::$(poetry run extract-release-notes)"
207+
208+
- name: find vsix
209+
id: find_vsix
210+
run: echo "::set-output name=vsix::$(find dist -iname '*.vsix')"
211+
212+
- name: Create Release
213+
id: create_release
214+
uses: actions/create-release@v1
215+
env:
216+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
217+
with:
218+
tag_name: ${{ github.ref }}
219+
release_name: ${{ github.ref }}
220+
body: ${{ steps.get_release_notes.outputs.release_notes }}
221+
draft: true
222+
prerelease: true
223+
224+
- name: Upload Release Asset
225+
id: upload-release-asset
226+
uses: actions/upload-release-asset@v1
227+
env:
228+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229+
with:
230+
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
233+
asset_content_type: application/vsix

0 commit comments

Comments
 (0)