Skip to content

Commit

Permalink
Merge branch 'main' of github.com:env0/vscode-env0 into fix-default-b…
Browse files Browse the repository at this point in the history
…ranch-doesn't-show-environments
  • Loading branch information
meniRoy committed Sep 21, 2023
2 parents bdce44f + 5f81c9e commit cf8dc33
Show file tree
Hide file tree
Showing 15 changed files with 17,273 additions and 5,437 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Bump Version, Create Tag, and Release

on:
workflow_dispatch:
inputs:
versionBump:
description: 'Version bump type'
required: true
default: 'minor'
type: choice
options:
- patch
- minor
- major

env:
MARKET_TOKEN: ${{ secrets.MARKETPLACE_ACCESS_TOKEN }}

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x

- name: Install dependencies
run: npm ci

- name: Configure Git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Upgrade package version and create tag
run: npm version ${{ github.event.inputs.versionBump }} -m "Upgrade to %s"

- name: Push changes
run: |
git push
git push --tags
- name: Get version and name from package.json
id: package_info
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_ENV
- name: Package VS Code extension
run: npx vsce package

- name: Create GitHub release and upload VSIX
uses: softprops/action-gh-release@v1
with:
files: '${{ env.name }}-${{ env.version }}.vsix'
tag_name: v${{ env.version }}
name: Release ${{ env.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to Visual Studio Marketplace
run: npx vsce publish -p "$MARKET_TOKEN" --packagePath '${{ env.name }}-${{ env.version }}.vsix'
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install pnpm
run: npm install -g [email protected]
- name: Install dependencies
run: pnpm install
run: npm ci
- name: Run unit tests
run: npm run unit:test
- name: Run integration tests
run: xvfb-run -a npm test
run: xvfb-run -a npm test
- name: Install VS Code Extension Manager
run: npm install -g @vscode/vsce
- name: Run packge
run: vsce package
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ When working with the tests, it is imperative to import the `mocks/vscode` file

The unit tests are executed on the source TypeScript files, not on the compiled files. We have integrated `ts-node` with Mocha to facilitate the compilation of files during testing.


## 🚀 How to Perform a Release

1. Navigate to the "Actions" tab in the GitHub repository.
2. Find and select the "Bump Version, Create Tag, and Release" workflow.
3. Click "Run workflow", select the desired `versionBump` option (patch, minor, or major) from the dropdown menu, and initiate the workflow.

The workflow automatically bumps the current version specified in your `package.json` file based on your input. Following this, it creates a new Git tag and releases the new version on GitHub and the Visual Studio Marketplace, all referencing the newly bumped version from the `package.json` file.

### 📚 Recommended Reading

We recommend familiarizing yourself with the following resources:
Expand Down
Loading

0 comments on commit cf8dc33

Please sign in to comment.