Skip to content

Build and Release

Build and Release #113

name: Build and Release
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * 2' # every Tuesday at 9 am UTC
jobs:
build:
uses: snyk/vscode-extension/.github/workflows/ci.yaml@main
secrets:
ITERATIVELY_KEY: ${{ secrets.ITERATIVELY_KEY }}
publish:
runs-on: ubuntu-latest
needs: build
environment: Stable
name: Publish extension
outputs:
new-version: ${{ steps.patched-tag.outputs.new_version }}
new-tag: ${{ steps.patched-tag.outputs.new_tag }}
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Setup VSCE
run: sudo npm install -g vsce@latest
- name: Install dependencies
run: npm ci
- name: Verify analytics events
run: npm run ampli:verify -- -t ${{ secrets.ITERATIVELY_KEY }}
- name: Bump patch version
id: patched-tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: main
default_bump: patch
- name: Add Credentials
run: |
sed -i \
-e 's|${env.SNYK_VSCE_SEGMENT_WRITE_KEY}|${{ secrets.SNYK_VSCE_SEGMENT_WRITE_KEY }}|g' \
-e 's|${env.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY}|${{ secrets.SNYK_VSCE_AMPLITUDE_EXPERIMENT_API_KEY }}|g' \
-e 's|${env.SNYK_VSCE_SENTRY_DSN_KEY}|${{ secrets.SNYK_VSCE_SENTRY_DSN_KEY }}|g' \
snyk.config.json
- name: Publish to Marketplace
run: vsce publish -p ${{ secrets.MARKETPLACE_TOKEN }} --no-update-package-json ${{ steps.patched-tag.outputs.new_version }}
release:
runs-on: ubuntu-latest
needs: publish
environment: Stable
name: Release
steps:
- name: Fetch sources
uses: actions/checkout@v2
- name: Setup VSCE
run: sudo npm install -g vsce@latest
- name: Install dependencies
run: npm ci
- name: Package VSIX
run: echo y | vsce package --no-git-tag-version --no-update-package-json ${{ needs.publish.outputs.new-version }}
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ needs.publish.outputs.new-tag }}
tag_name: ${{ needs.publish.outputs.new-tag }}
body: '${{ steps.extract-release-notes.outputs.release_notes }}'
draft: false
prerelease: false
fail_on_unmatched_files: true
files: |
**/*.vsix