Skip to content

Merge pull request #721 from swyddfa/develop #2

Merge pull request #721 from swyddfa/develop

Merge pull request #721 from swyddfa/develop #2

name: 'Release: vscode'
on:
push:
branches:
- release
paths:
- 'code/**'
jobs:
release:
runs-on: ubuntu-latest
environment:
name: vscode-marketplace
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-node@v4'
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'code/package-lock.json'
- uses: 'actions/setup-python@v5'
with:
# This must be the minimum Python version we support
python-version: "3.8"
- name: pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-vscode-pip-deps-${{ hashFiles('code/requirements.txt') }}
restore-keys: |
${{ runner.os }}-vscode-pip-deps
- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade tox hatch towncrier docutils
name: Install Build Tools
- run: |
set -e
./scripts/make_release.py vscode
name: Set Version
- run: |
set -e
cd code
# Use version of esbonio on PyPi for release builds
ESBONIO_WHL=esbonio tox run -e bundle-deps
npm ci --prefer-offline
npm run package
name: Package Extension
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: 'vsix'
path: code/*.vsix
if-no-files-found: error
- name: 'Publish Extension'
run: |
cd code
npm run deploy
env:
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
- name: Create Release
run: |
gh release create "${RELEASE_TAG}" \
--title "Esbonio VSCode Extension v${VERSION} - ${RELEASE_DATE}" \
-F code/.changes.html \
./code/*.vsix
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}