Skip to content

Version Packages (#151) #113

Version Packages (#151)

Version Packages (#151) #113

Workflow file for this run

name: Release
on:
push:
branches:
- main
# Allows maintainers to manually rerun release publishing without
# manufacturing a new commit or reverting a version PR.
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
release:
name: Release
# Only publish from main even if workflow_dispatch is run from another ref.
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout Repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
- name: Setup Node.js 20.x
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
# npm 11.5.1 or later must be installed of OIDC to work
- name: Update npm
run: npm install -g npm@latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: TurboRepo Build
run: bun turbo build -F "{packages/*}" -F "{apps/vscode-extensions/*}"
- name: Check Types
run: bun turbo check-types -F "{packages/*}" -F "{apps/vscode-extensions/*}"
- name: Lint
run: bun turbo lint -F "{packages/*}" -F "{apps/vscode-extensions/*}"
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
# Add the patch lock script so that the lockfile uses the updated package versions
version: bun run version
# ChangeSets splits this into an array of string args, so we don't add quotes to the filter
# --env-mode=loose makes sure that the OIDC vars are passed to the publish scripts
publish: bun turbo ci:publish -F {packages/*} -F {apps/vscode-extensions/*} --env-mode=loose
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}