This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
🎉 Release #23
Workflow file for this run
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: 🎉 Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
with: | |
fetch-depth: 0 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Set node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
cache: pnpm | |
- run: npx changelogithub | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{secrets.GH_TOKEN}} | |
- name: Install | |
run: pnpm install --no-frozen-lockfile | |
- name: Build | |
run: pnpm run build | |
- name: Set Timezone | |
run: | | |
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
echo "Asia/Shanghai" | sudo tee /etc/timezone | |
date | |
shell: bash | |
- name: Set npmrc for all packages | |
run: | | |
for package in $(find dist/* -maxdepth 0 -type d); do | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ${package}/.npmrc | |
done | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Set npmrc for root packages | |
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > dist/.npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to npm | |
run: pnpm run publish:script |