chore: remove changelog file (#16) #20
This file contains hidden or 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: Release Workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 # We only need the current and the previous commit | |
- name: Check if the package.version has changed | |
id: check_changes | |
run: | | |
if git diff --unified=0 main~ package.json | grep '"version":'; then | |
echo "changes=detected" >> $GITHUB_OUTPUT | |
else | |
echo "changes=none" >> $GITHUB_OUTPUT | |
fi | |
outputs: | |
changes: ${{ steps.check_changes.outputs.changes }} | |
build: | |
runs-on: ubuntu-latest | |
needs: check-changes | |
if: needs.check-changes.outputs.changes == 'detected' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: |- | |
npm install | |
npm install -g vsce | |
# - name: Run tests | |
# run: npm test | |
- name: Build VSIX file | |
run: vsce package -o sysdig-vscode-ext.vsix | |
- name: Get current version | |
id: version | |
run: echo "version=$(jq -r '.version' package.json)" >> "$GITHUB_OUTPUT" | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: Release ${{ steps.version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload VSIX file | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./sysdig-vscode-ext.vsix | |
asset_name: sysdig-vscode-ext.vsix | |
asset_content_type: application/vsix | |
- name: Publish VSIX to the marketplace | |
env: | |
VSCE_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} | |
run: | | |
vsce publish |