Skip to content

Commit a59623c

Browse files
committed
fix: restructure release workflow for improved artifact publishing
fixes #103 Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent 87df4ab commit a59623c

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
config-file: .github/release-please-config.json
2626
manifest-file: .github/release-please-manifest.json
2727

28-
publish:
28+
release-artifacts:
2929
needs: [release-please]
3030
if: ${{ needs.release-please.outputs.release_created == 'true' }}
3131
runs-on: ubuntu-latest
@@ -50,11 +50,9 @@ jobs:
5050
with:
5151
submodules: true
5252
ref: ${{ steps.event_details.outputs.tag_name }}
53-
- name: Add files and publish release
53+
- name: Build VSIX and upload to release
5454
env:
5555
GITHUB_TOKEN: ${{ github.token }}
56-
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
57-
OVSX_PAT: ${{ secrets.OVSX_PAT }}
5856
TAG_NAME: ${{ steps.event_details.outputs.tag_name }}
5957
run: |
6058
npm ci
@@ -63,11 +61,45 @@ jobs:
6361
gh release upload ${TAG_NAME} gordonsmith.observable-js.vsix
6462
mv observable-js.vsix ${TAG_NAME}.vsix
6563
gh release upload ${TAG_NAME} ${TAG_NAME}.vsix
66-
npx vsce publish --packagePath ${TAG_NAME}.vsix
67-
npx ovsx publish ${TAG_NAME}.vsix -p ${OVSX_PAT}
64+
65+
publish-vsce:
66+
needs: [release-please, release-artifacts]
67+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
steps:
72+
- name: Download VSIX asset
73+
env:
74+
GITHUB_TOKEN: ${{ github.token }}
75+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
76+
run: gh release download ${TAG_NAME} --pattern "${TAG_NAME}.vsix"
77+
- name: Publish to VS Code Marketplace
78+
env:
79+
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
80+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
81+
run: npx vsce publish --packagePath ${TAG_NAME}.vsix
82+
83+
publish-ovsx:
84+
needs: [release-please, release-artifacts, publish-vsce]
85+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
86+
runs-on: ubuntu-latest
87+
permissions:
88+
contents: write
89+
steps:
90+
- name: Download VSIX asset
91+
env:
92+
GITHUB_TOKEN: ${{ github.token }}
93+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
94+
run: gh release download ${TAG_NAME} --pattern "${TAG_NAME}.vsix"
95+
- name: Publish to Open VSX Registry
96+
env:
97+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
98+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
99+
run: npx ovsx publish ${TAG_NAME}.vsix -p ${OVSX_PAT}
68100

69101
label:
70-
needs: [publish]
102+
needs: [publish-ovsx, release-artifacts]
71103
runs-on: ubuntu-latest
72104
permissions:
73105
contents: read
@@ -86,7 +118,7 @@ jobs:
86118
gh pr edit ${PR_NUMBER} --add-label 'autorelease: published'
87119
88120
comments:
89-
needs: [publish]
121+
needs: [publish-ovsx, release-artifacts]
90122
runs-on: ubuntu-latest
91123
permissions:
92124
contents: write
@@ -97,9 +129,11 @@ jobs:
97129
with:
98130
GITHUB_TOKEN: ${{ github.token }}
99131
comment-template: |
100-
:tada: This change has been included in ${{ needs.publish.outputs.tag_name }} :tada:
132+
:tada: This change has been included in ${{ needs.release-artifacts.outputs.tag_name }} :tada:
101133
102134
The release is available on:
103135
- GitHub releases: {release_link}
136+
- VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=gordonsmith.observable-js
137+
- Open VSX Registry: https://open-vsx.org/extension/gordonsmith/observable-js
104138
105139
Your **[release-please](https://github.com/googleapis/release-please)** bot :rocket::pray:

0 commit comments

Comments
 (0)