Skip to content

Commit 3cabccd

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 3cabccd

1 file changed

Lines changed: 45 additions & 9 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 45 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,47 @@ 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+
- uses: actions/checkout@v4
73+
- name: Download VSIX asset
74+
env:
75+
GITHUB_TOKEN: ${{ github.token }}
76+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
77+
run: gh release download ${TAG_NAME} --pattern "${TAG_NAME}.vsix"
78+
- name: Publish to VS Code Marketplace
79+
env:
80+
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
81+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
82+
run: npx vsce publish --packagePath ${TAG_NAME}.vsix
83+
84+
publish-ovsx:
85+
needs: [release-please, release-artifacts]
86+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
87+
runs-on: ubuntu-latest
88+
permissions:
89+
contents: write
90+
steps:
91+
- uses: actions/checkout@v4
92+
- name: Download VSIX asset
93+
env:
94+
GITHUB_TOKEN: ${{ github.token }}
95+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
96+
run: gh release download ${TAG_NAME} --pattern "${TAG_NAME}.vsix"
97+
- name: Publish to Open VSX Registry
98+
env:
99+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
100+
TAG_NAME: ${{ needs.release-artifacts.outputs.tag_name }}
101+
run: npx ovsx publish ${TAG_NAME}.vsix -p ${OVSX_PAT}
68102

69103
label:
70-
needs: [publish]
104+
needs: [release-artifacts, publish-vsce, publish-ovsx]
71105
runs-on: ubuntu-latest
72106
permissions:
73107
contents: read
@@ -86,7 +120,7 @@ jobs:
86120
gh pr edit ${PR_NUMBER} --add-label 'autorelease: published'
87121
88122
comments:
89-
needs: [publish]
123+
needs: [release-artifacts, publish-vsce, publish-ovsx]
90124
runs-on: ubuntu-latest
91125
permissions:
92126
contents: write
@@ -97,9 +131,11 @@ jobs:
97131
with:
98132
GITHUB_TOKEN: ${{ github.token }}
99133
comment-template: |
100-
:tada: This change has been included in ${{ needs.publish.outputs.tag_name }} :tada:
134+
:tada: This change has been included in ${{ needs.release-artifacts.outputs.tag_name }} :tada:
101135
102136
The release is available on:
103137
- GitHub releases: {release_link}
138+
- VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=gordonsmith.observable-js
139+
- Open VSX Registry: https://open-vsx.org/extension/gordonsmith/observable-js
104140
105141
Your **[release-please](https://github.com/googleapis/release-please)** bot :rocket::pray:

0 commit comments

Comments
 (0)