Update ci.yml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- created | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
- run: npm install && npm i -g @vscode/vsce && vsce package | |
if: runner.os == 'Linux' | |
release-please: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
with: | |
release-type: node | |
package-name: mcap-cli-vscode-${{ steps.release.outputs.tag_name }} | |
command: github-release | |
bump-patch-for-minor-pre-major: true | |
- name: Publish and Upload Release Artifact | |
if: ${{ steps.release.outputs.release_created }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
run: | | |
npm i | |
npx vsce package | |
npx vsce publish -p ${{ secrets.VSCE_PAT }} | |
echo tag_name: ${{ steps.release.outputs.tag_name }} | |
gh release upload ${{ steps.release.outputs.tag_name }} ./mcap-cli-vscode-${{ steps.release.outputs.tag_name }}.vsix | |