Version Packages (#945) #639
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Changelog | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: Changelog | |
if: ${{ github.repository_owner == 'withastro' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out branch | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@master | |
with: | |
version: pnpm run version | |
publish: pnpm release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Prepare vscode folder | |
if: steps.changesets.outputs.published == 'true' | |
working-directory: ./packages/vscode | |
run: | | |
sleep 60s | |
rm -rf node_modules | |
npm i | |
npm run build:grammar | |
- name: Publish to VSCode Marketplace | |
if: steps.changesets.outputs.published == 'true' | |
working-directory: ./packages/vscode | |
run: | | |
npm run build | |
npx vsce publish -p ${{ secrets.VSCE_TOKEN }} --target win32-x64 win32-arm64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64 alpine-x64 alpine-arm64 | |
- name: Publish to OpenVSX | |
if: steps.changesets.outputs.published == 'true' | |
working-directory: ./packages/vscode | |
run: | | |
npm run build | |
npx ovsx publish -p ${{ secrets.OVSX_TOKEN }} --target win32-x64 win32-arm64 linux-x64 linux-arm64 linux-armhf darwin-x64 darwin-arm64 alpine-x64 alpine-arm64 |