Skip to content

Publish

Publish #42

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
nightly:
type: boolean
default: true
required: false
description: 'Publish a nightly build'
jobs:
build:
name: Build
uses: ./.github/workflows/_build.yaml
package:
name: Package
needs: [build]
uses: ./.github/workflows/_package.yaml
with:
# If the workflow was triggered by a schedule event, or the nightly
# input is true, package a nightly build
nightly: ${{ github.event.inputs.nightly == 'true' }}
publish-vs-marketplace:
name: Publish to Visual Studio Marketplace
needs: [package]
runs-on: ubuntu-latest
environment: vscode
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Download the artifact
uses: actions/download-artifact@v4
with:
name: biome.vsix
- name: Debug secret
run: echo -n "${{ secrets.VSCE_PAT }}" | wc -c
- name: Publish extension to Visual Studio Marketplace
run: pnpm exec vsce publish --packagePath biome.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
publish-ovsx-registry:
name: Publish to Open VSX Registry
needs: [package]
runs-on: ubuntu-latest
environment: vscode
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Download the artifact
uses: actions/download-artifact@v4
with:
name: biome.vsix
- name: Publish extension to Open VSX Registry
run: pnpm exec ovsx publish --packagePath biome.vsix
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
publish-github-release:
name: Publish to GitHub Releases
needs: [package]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Download the artifact
uses: actions/download-artifact@v4
with:
name: biome.vsix
- name: Generate release notes
id: release-notes
uses: orhun/git-cliff-action@v2
with:
config: cliff.toml
args: -vv --latest --strip header 0544a0e103df4308c92b302ac3b22a1e3c26a64d..
env:
OUTPUT: CHANGES.md
- name: Strip tag from release notes
run: tail -n +3 < CHANGES.md > RELEASE_NOTES.md
- name: Publish extension to GitHub Releases
uses: softprops/action-gh-release@v1
with:
name: "${{ format('v{0}', needs.package.outputs.version) }}${{ needs.package.outputs.nightly == 'true' && ' (nightly)' || '' }}"
body_path: RELEASE_NOTES.md
prerelease: ${{ needs.package.outputs.nightly == 'true' }}
files: biome.vsix
tag_name: ${{ format('v{0}', needs.package.outputs.version) }}