Skip to content

πŸŽ‰ Release

πŸŽ‰ Release #139

Workflow file for this run

name: πŸŽ‰ Release
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
prepare:
if: ${{ github.event.inputs.version != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: πŸ” Set all monorepo's package version
run: |
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./package.json')); package.version = '${{ github.event.inputs.version }}'; fs.writeFileSync('./package.json', JSON.stringify(package, null, 2) + '\n');"
for package in $(ls packages); do
node -e "const fs = require('fs'); const package = JSON.parse(fs.readFileSync('./packages/$package/package.json')); package.version = '${{ github.event.inputs.version }}'; fs.writeFileSync('./packages/$package/package.json', JSON.stringify(package, null, 2) + '\n');"
done
- name: πŸ“ Commit and push changes
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add -A
git commit -m "chore(release): v${{ github.event.inputs.version }}" || exit 0
git push
git tag -a v${{ github.event.inputs.version }} -m "v${{ github.event.inputs.version }}"
git push origin v${{ github.event.inputs.version }}
release-npm:
needs: [prepare]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: v${{ github.event.inputs.version }}
- name: Install pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
- name: 🚚 Install & Build & Publish
run: |
pnpm i
pnpm build
pnpm publish --access public -r --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
dispatch-docs:
needs: [release-npm]
runs-on: ubuntu-latest
steps:
- name: Invoke deployment hook
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GH_TOKEN }}
repository: dream-num/univer.ai
event-type: deploy