Skip to content

workflow: Fix release pipeline #11

workflow: Fix release pipeline

workflow: Fix release pipeline #11

Workflow file for this run

name: 'Release'
on:
push:
branches:
- release
paths:
- 'code/**'
- 'lib/esbonio/**'
jobs:
lsp-release:
name: esbonio release
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/esbonio
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade hatch towncrier docutils
name: Setup Environment
- run: |
set -e
./scripts/make_release.py lsp
name: Set Version
id: info
- name: Package
run: |
cd lib/esbonio
hatch build
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: 'dist'
path: lib/esbonio/dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: lib/esbonio/dist/
- name: Create Release
run: |
gh release create "${RELEASE_TAG}" \
--title "Esbonio Language Server v${VERSION} - ${RELEASE_DATE}" \
-F lib/esbonio/.changes.html \
./lib/esbonio/dist/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-vsix:
needs: lsp-release
runs-on: ubuntu-latest
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@v4
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 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="--pre esbonio" make dist
name: Package Extension
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: 'vsix'
path: code/*.vsix
if-no-files-found: error
- 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 }}
marketplace-release:
name: vscode release
needs: build-vsix
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/download-artifact@v4
name: 'Download Extension'
with:
name: 'vsix'
path: code
- name: 'Publish Extension'
run: |
cd code
npm ci --prefer-offline
npm run deploy-vsce
env:
VSCE_PAT: ${{ secrets.VSCODE_PAT }}
open-vsx-release:
name: open vsx release
needs: build-vsix
runs-on: ubuntu-latest
environment:
name: open-vsx
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/download-artifact@v4
name: 'Download Extension'
with:
name: 'vsix'
path: code
- name: 'Publish Extension'
run: |
cd code
npm ci --prefer-offline
npm run deploy-ovsx
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}