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.
- Use manual `npm config` 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 2853f85
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,39 @@ 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
- name: npm config
run: |
npm config set //npm.pkg.github.com/remarkjs/:_authToken=\${NODE_AUTH_TOKEN}
npm config set registry https://npm.pkg.github.com/remarkjs/
npm config set always-auth false
- run: |
cat ~/.npmrc || true
cat /home/runner/work/_temp/.npmrc || true
- run: npm publish
env:
NODE_AUTH_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 }}
2 changes: 1 addition & 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 Down

0 comments on commit 2853f85

Please sign in to comment.