chore: release v3.0.7 #50
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*' | |
permissions: | |
contents: read | |
jobs: | |
build-release: | |
runs-on: ubuntu-latest | |
if: github.repository == 'tinylibs/tinybench' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: pnpm | |
- uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Install dependencies | |
run: pnpm install --ignore-scripts --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Type check | |
run: pnpm typecheck | |
- name: Lint | |
run: pnpm lint | |
- name: Run unit tests | |
run: pnpm test | |
env: | |
FORCE_COLOR: 2 | |
- name: Run examples | |
run: cd examples && pnpm all | |
publish-npm: | |
runs-on: ubuntu-latest | |
needs: build-release | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: https://registry.npmjs.org/ | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --ignore-scripts --frozen-lockfile | |
- name: Read package.json version | |
id: package-version | |
uses: jaywcjlove/github-action-package@main | |
- name: Publish release | |
run: pnpm publish --no-git-checks | |
if: ${{ contains(steps.package-version.outputs.version, '-') == false }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish release candidate | |
if: ${{ contains(steps.package-version.outputs.version, '-rc') == true }} | |
run: pnpm publish --no-git-checks --tag next | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish beta release | |
if: ${{ contains(steps.package-version.outputs.version, '-beta') == true }} | |
run: pnpm publish --no-git-checks --tag beta | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish alpha release | |
if: ${{ contains(steps.package-version.outputs.version, '-alpha') == true }} | |
run: pnpm publish --no-git-checks --tag alpha | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
changelog: | |
runs-on: ubuntu-latest | |
needs: publish-npm | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- run: npx changelogithub | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-documentation: | |
runs-on: ubuntu-latest | |
needs: changelog | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.repository.default_branch }} | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: pnpm | |
- name: Generate documentation | |
run: | | |
pnpm install --ignore-scripts --frozen-lockfile | |
pnpm typedoc | |
- name: Commit and push changes | |
if: github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' | |
env: | |
COMMIT_MESSAGE: 'docs: publish documentation' | |
COMMIT_AUTHOR: Documentation Bot | |
COMMIT_EMAIL: documentation-bot@users.noreply.github.com | |
run: | | |
git config --local user.name "${{ env.COMMIT_AUTHOR }}" | |
git config --local user.email "${{ env.COMMIT_EMAIL }}" | |
git pull | |
git add ./docs | |
git commit -a -m "${{ env.COMMIT_MESSAGE }}" | |
git push |