Skip to content

Update dependencies (#1620) #1181

Update dependencies (#1620)

Update dependencies (#1620) #1181

Workflow file for this run

name: Release
on:
push:
branches:
- main
- next
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
steps:
- uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
# This makes the PR pushed to use GITHUB_TOKEN and trigger the checks
persist-credentials: false
- name: Configure
run: |
git config user.email "[email protected]"
git config user.name "Xata"
echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
id: config
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ steps.config.outputs.NVMRC }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.config.outputs.NVMRC }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Update next channel
if: github.ref_name == 'next'
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
run: |
npx changeset version
npx changeset publish
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
id: changesets
if: github.ref_name == 'main'
with:
title: Release tracking
publish: npx changeset publish
version: node ./scripts/changeset-version.mjs
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
release-assets:
name: Release CLI assets
needs: [release]
if: needs.release.outputs.published == 'true' && github.ref_name == 'main'
uses: ./.github/workflows/release-cli-assets.yml
with:
publishedPackages: ${{ needs.release.outputs.publishedPackages }}
commitSha: ${{ github.sha }}
secrets: inherit