Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ adding initial release workflow #31

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release

on:
push:
branches:
- "main"
- "release-*"

pull_request:
branches:
- "main"
- "release-*"

workflow_dispatch:
inputs:
release_branch:
description: 'Branch to release (e.g., main, release-1.0)'
default: 'main'
architectures:
description: 'Arch to build'
default: 'linux, macos, windows'
run_tests:
description: 'Run tests before packaging and releasing'
default: 'true'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: linux
max-parallel: 1
if: ${{ contains (github.event.inputs.architectures, matrix.arch ) || github.event_name != 'workflow_dispatch' }}
steps:
- name: checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || github.ref }}

- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: "vscode/.nvmrc"

- name: Cache extension node_modules
uses: actions/cache@v3
with:
path: vscode/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('vscode/package-lock.json') }}

- name: Install dependencies
run: |
cd vscode
npm version
npm ci

- name: Lint sources
run: |
cd vscode
npm run lint

- name: Build
run: |
cd vscode
npm run package

- name: Generate .vsix package
run: |
npm install -g @vscode/vsce
cd vscode
vsce package

- name: Upload VSIX artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension-${{ matrix.arch }}-${{ github.run_id }}
path: "*.vsix"

Loading