Skip to content

Commit

Permalink
Add publish-vsce job
Browse files Browse the repository at this point in the history
- Add publish-vsce job to publish the extension to the Visual Studio Code Extension Marketplace.
- Remove the `@remarkjs` scope since VSCE doesn't like it.
- Add .npmrc instead of `actions/setup-node@v2` since the latter only seems to work with scoped packages (see actions/setup-node#73).
  • Loading branch information
asbjornu committed Mar 17, 2021
1 parent 51642f7 commit b2e8dea
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
30 changes: 25 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,31 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: vscode-remark
- uses: actions/setup-node@v2
with:
registry-url: https://npm.pkg.github.com/remarkjs/
scope: '@remarkjs'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-vsce:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- uses: actions/download-artifact@v2
with:
name: vscode-remark
- name: install vsce
run: npm install -g vsce
- run: vsce package
- uses: actions/upload-artifact@v2
with:
name: vscode-remark.vsix
path: '*.vsix'
- name: vsce publish
run: vsce publish --pat ${{ secrets.VSCE_TOKEN }}
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//npm.pkg.github.com/remarkjs/:_authToken=${NPM_TOKEN}
registry=https://npm.pkg.github.com/remarkjs/
always-auth=true
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@remarkjs/vscode-remark",
"name": "vscode-remark",
"displayName": "Remark ",
"description": "Beautify markdown code with Remark",
"version": "1.2.1",
Expand All @@ -14,6 +14,9 @@
"type": "git",
"url": "https://github.com/remarkjs/vscode-remark"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/remarkjs/"
},
"keywords": [
"markdown",
"remark",
Expand Down

0 comments on commit b2e8dea

Please sign in to comment.