Skip to content

Release (#248)

Release (#248) #12

Workflow file for this run

on:
push:
branches:
- main
paths:
- .changeset/**/*
workflow_dispatch:
name: CD
jobs:
changesets:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
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
- uses: actions/setup-node@v3
with:
node-version: 20
- run: corepack enable
- uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: v1-${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Update release PR / Publish packages to `npm`
id: changesets
uses: changesets/action@v1
with:
title: Release
commit: Release new version
publish: pnpm release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Upload binaries to release
if: ${{ steps.changesets.outputs.published == 'true' }}
run: gh release upload --clobber $(git tag) dist-pkg/*
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GITHUB_TOKEN }}