-
Notifications
You must be signed in to change notification settings - Fork 16
Add publishing workflow #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Publish Extension | ||
|
|
||
| on: | ||
| release: | ||
| types: [published, prereleased] | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version-file: ".nvmrc" | ||
| cache: "npm" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
|
|
||
| - name: Package extension (regular) | ||
| if: github.event.release.prerelease == false | ||
| run: npm run package | ||
| - name: Package extension (pre-release) | ||
| if: github.event.release.prerelease == true | ||
| run: npm run package:prerelease | ||
|
|
||
| - name: Set up git credentials | ||
| run: | | ||
| git config user.name "${{ github.actor }}" | ||
| git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
|
Comment on lines
+32
to
+33
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need this to do the |
||
| - name: Publish to VS Code Marketplace (regular) | ||
| if: github.event.release.prerelease == false | ||
| # NOTE: ${{github.event.release.tag_name}} is the tag name from the release. | ||
| # Ref: https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#release | ||
| # Using `@vscode/vsce publish <version>` will tag a new commit with the version in package.json. | ||
| # Ref: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#autoincrement-the-extension-version | ||
| run: npm exec @vscode/vsce publish ${{ github.event.release.tag_name }} --packagePath *.vsix | ||
| env: | ||
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
| - name: Publish to VS Code Marketplace (pre-release) | ||
| if: github.event.release.prerelease == true | ||
| run: npm exec @vscode/vsce publish ${{ github.event.release.tag_name }} --pre-release --packagePath *.vsix | ||
| env: | ||
| VSCE_PAT: ${{ secrets.VSCE_PAT }} | ||
|
|
||
| - name: Push version commit | ||
| run: | | ||
| git push origin HEAD:${{ github.event.repository.default_branch }} | ||
|
Comment on lines
+50
to
+52
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, I think after the action creates the commit, we should push the commit directly to HEAD (it'll just be bumping the |
||
| - name: Publish to OpenVSX (regular) | ||
| if: github.event.release.prerelease == false | ||
| run: npm exec ovsx publish *.vsix | ||
| env: | ||
| OVSX_PAT: ${{ secrets.OVSX_PAT }} | ||
| - name: Publish to OpenVSX (pre-release) | ||
| if: github.event.release.prerelease == true | ||
| run: npm exec ovsx publish *.vsix --pre-release | ||
| env: | ||
| OVSX_PAT: ${{ secrets.OVSX_PAT }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seemed like we should use
npm ciin CI, notnpm install...