Skip to content

Commit

Permalink
CM-40776 - Automate marketplace publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Oct 28, 2024
1 parent 9f8d9fd commit 453bf1b
Showing 1 changed file with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Lint and build
name: Lint and build. Publish on tag/release creation

on: [ push ]

permissions:
contents: read
contents: write

jobs:
lint_test_build:
lint_build_publish:
runs-on: ubuntu-latest
steps:
- name: Run Cimon (eBPF)
Expand All @@ -28,22 +28,38 @@ jobs:
node-version: 18

- name: Install dependencies
run: npm install
run: |
npm install
npm install -g @vscode/vsce
- name: Code Linting
run: npm run lint

- name: Build extension
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: |
npm install -g @vscode/vsce
vsce package
mv *.vsix cycode-extension.vsix
run: vsce package

- name: Upload extension package to artifacts
uses: actions/upload-artifact@v3
with:
name: cycode-extension.vsix
path: cycode-extension.vsix
retention-days: 14
name: cycode-extension
path: "*.vsix"
if-no-files-found: error

- name: Publish extension to marketplace
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0)
if: startsWith(github.ref, 'refs/tags/v')
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
run: vsce publish

- name: Publish extension to GitHub Release
# it runs on tag creation only which starts with 'v' (e.g., v1.0.0)
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
file: cycode-extension.vsix
tag: ${{ github.ref }}
overwrite: true

0 comments on commit 453bf1b

Please sign in to comment.