committed by
GitHub
22 changed files with 608 additions and 922 deletions
@ -0,0 +1,25 @@ |
|||
// Runs before `changeset version` (see the `version-packages` script). Icons
|
|||
// are added without changesets, so the ones not released yet (no `version` in
|
|||
// their frontmatter) get a generated changeset: it makes the release a minor one
|
|||
// and lists the icons in the changelog.
|
|||
import { writeFileSync } from 'fs'; |
|||
import { resolve } from 'path'; |
|||
import { HOME_DIR, getAllIcons } from './helpers.mjs'; |
|||
|
|||
const newIcons = Object.entries(getAllIcons()).flatMap(([type, icons]) => |
|||
icons.filter((icon) => !icon.version).map((icon) => `${type}/${icon.name}`), |
|||
); |
|||
|
|||
if (newIcons.length > 0) { |
|||
const plural = newIcons.length > 1 ? 's' : ''; |
|||
|
|||
writeFileSync( |
|||
resolve(HOME_DIR, '.changeset/new-icons.md'), |
|||
`---\n'@tabler/icons': minor\n---\n\n` + |
|||
`${newIcons.length} new icon${plural}\n\n` + |
|||
newIcons.map((icon) => `- \`${icon}\``).join('\n') + |
|||
'\n', |
|||
); |
|||
|
|||
console.log(`Added a changeset for ${newIcons.length} new icon${plural}`); |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
// Prints the notes of the current release: the preview image of the new icons
|
|||
// followed by the section of the @tabler/icons changelog for this version.
|
|||
//
|
|||
// --ref <git ref> ref the image is loaded from (default: the `v<version>` tag)
|
|||
// --image-only print just the image
|
|||
import { existsSync, readFileSync } from 'fs'; |
|||
import { resolve } from 'path'; |
|||
import { GITHUB_DIR, PACKAGES_DIR, getArgvs } from './helpers.mjs'; |
|||
|
|||
const { version } = JSON.parse(readFileSync(resolve(PACKAGES_DIR, 'icons/package.json'), 'utf-8')); |
|||
const argvs = getArgvs(); |
|||
const repo = process.env.GITHUB_REPOSITORY || 'tabler/tabler-icons'; |
|||
const ref = argvs.ref || `v${version}`; |
|||
|
|||
const image = `tabler-icons-${version}@2x.png`; |
|||
|
|||
if (existsSync(resolve(GITHUB_DIR, image))) { |
|||
console.log( |
|||
`<img width="584" src="https://raw.githubusercontent.com/${repo}/${ref}/.github/${image}" />\n`, |
|||
); |
|||
} |
|||
|
|||
if (!argvs['image-only']) { |
|||
const changelogPath = resolve(PACKAGES_DIR, 'icons/CHANGELOG.md'); |
|||
const changelog = existsSync(changelogPath) ? readFileSync(changelogPath, 'utf-8') : ''; |
|||
const [, section = ''] = |
|||
changelog.match( |
|||
new RegExp(`^## ${version.replace(/\./g, '\\.')}\\n([\\s\\S]*?)(?=^## |(?![\\s\\S]))`, 'm'), |
|||
) || []; |
|||
|
|||
console.log(section.trim()); |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
// Runs after `changeset version` (see the `version-packages` script) on the
|
|||
// "Version Packages" branch: brings everything outside of the workspace
|
|||
// packages to the version Changesets picked and generates the preview image
|
|||
// of the icons released in it.
|
|||
import { execSync } from 'child_process'; |
|||
import { readFileSync, writeFileSync } from 'fs'; |
|||
import { resolve } from 'path'; |
|||
import { HOME_DIR, PACKAGES_DIR } from './helpers.mjs'; |
|||
|
|||
const { version } = JSON.parse(readFileSync(resolve(PACKAGES_DIR, 'icons/package.json'), 'utf-8')); |
|||
|
|||
console.log(`Preparing release ${version}`); |
|||
|
|||
// The root package.json is not a workspace package, Changesets leaves it alone
|
|||
const rootPackagePath = resolve(HOME_DIR, 'package.json'); |
|||
const rootPackage = JSON.parse(readFileSync(rootPackagePath, 'utf-8')); |
|||
rootPackage.version = version; |
|||
writeFileSync(rootPackagePath, `${JSON.stringify(rootPackage, null, 2)}\n`); |
|||
|
|||
const run = (script) => |
|||
execSync(`pnpm run ${script}`, { |
|||
cwd: HOME_DIR, |
|||
stdio: 'inherit', |
|||
env: { ...process.env, NEW_VERSION: version }, |
|||
}); |
|||
|
|||
// Same steps as the `build` script, minus building the packages: icons added
|
|||
// since the last release get their `unicode` and `version` here
|
|||
run('validate'); |
|||
run('update'); |
|||
run('validate --hard'); |
|||
run('optimize'); |
|||
run('changelog-image'); |
|||
run('update-readme'); |
|||
@ -0,0 +1,23 @@ |
|||
# Changesets |
|||
|
|||
Every pull request that should end up in a release adds a changeset: |
|||
|
|||
```bash |
|||
pnpm changeset |
|||
``` |
|||
|
|||
All `@tabler/icons*` packages are released together with the same version (a |
|||
`fixed` group). Pick the packages the change affects, usually as a `patch`. |
|||
|
|||
New icons do not need a changeset: icons that do not have a `version` in their |
|||
frontmatter yet are listed in a changeset generated when the release is |
|||
prepared (`.build/release-changeset.mjs`). Any new icon therefore opens the |
|||
release pull request on its own and makes it a minor release. |
|||
|
|||
On every push to `main` the Release workflow opens (or updates) a "Version |
|||
Packages" pull request. Its description starts with a preview image of the icons |
|||
that will be released, i.e. icons that do not have a `version` in their |
|||
frontmatter yet. Merging that pull request publishes the packages to npm and |
|||
creates the `vX.Y.Z` GitHub release. |
|||
|
|||
See https://changesets.dev for the full documentation. |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons': patch |
|||
--- |
|||
|
|||
pr: #1643 |
|||
author: @codecalm |
|||
|
|||
Add `alphabet`, `arabic`, `typography` and `character` tags to `alphabet-arabic` |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons': patch |
|||
--- |
|||
|
|||
pr: #1615 |
|||
author: @Bartosz-Do |
|||
|
|||
Match `brand-instagram` size to other square brand icons |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"baseBranch": "main", |
|||
"access": "public", |
|||
"changelog": ["@changesets/changelog-github", { "repo": "tabler/tabler-icons" }], |
|||
"commit": false, |
|||
"fixed": [["@tabler/icons*"]], |
|||
"privatePackages": { "version": false, "tag": false } |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons': patch |
|||
--- |
|||
|
|||
pr: #1614 |
|||
author: @Bartosz-Do |
|||
|
|||
Fix `square-dashed` icon drawn as a solid square |
|||
@ -0,0 +1,13 @@ |
|||
--- |
|||
'@tabler/icons-react': patch |
|||
'@tabler/icons-react-native': patch |
|||
'@tabler/icons-preact': patch |
|||
'@tabler/icons-vue': patch |
|||
'@tabler/icons-solidjs': patch |
|||
'@tabler/icons-astro': patch |
|||
--- |
|||
|
|||
pr: #1634 |
|||
author: @codecalm |
|||
|
|||
Stop publishing source maps, which made up about 70% of the package size |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons-react-native': patch |
|||
--- |
|||
|
|||
pr: #1628 |
|||
author: @codecalm |
|||
|
|||
Stop passing extra props (`testID`, `style`, `onPress`, …) to every node of the icon, only the root `Svg` gets them. `title` is now exposed to screen readers via accessibility props |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons': patch |
|||
--- |
|||
|
|||
pr: #1640 |
|||
author: @codecalm |
|||
|
|||
Redraw `square-dashed` and `table-dashed` icons |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons': patch |
|||
--- |
|||
|
|||
pr: #1641 |
|||
author: @codecalm |
|||
|
|||
Add `squircle` tag to all `square-rounded` icons |
|||
@ -0,0 +1,9 @@ |
|||
--- |
|||
'@tabler/icons-svelte': patch |
|||
'@tabler/icons-svelte-runes': patch |
|||
--- |
|||
|
|||
pr: #1630 |
|||
author: @codecalm |
|||
|
|||
Add `default` export conditions and document per-icon imports |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons-webfont': patch |
|||
--- |
|||
|
|||
pr: #1616 |
|||
author: @Bartosz-Do |
|||
|
|||
Fix filled `home` webfont glyph having zero width in Chrome |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons-webfont': patch |
|||
--- |
|||
|
|||
pr: #1633 |
|||
author: @codecalm |
|||
|
|||
Fix `sass` and `style` fields in `package.json` to point to `dist/`, and stop publishing the intermediate SVG fonts, which the CSS never referenced |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons-webfont': patch |
|||
--- |
|||
|
|||
pr: #1624 |
|||
author: @codecalm |
|||
|
|||
Make webfont builds reproducible, so font files no longer change between builds of the same icons |
|||
@ -0,0 +1,8 @@ |
|||
--- |
|||
'@tabler/icons-webfont': patch |
|||
--- |
|||
|
|||
pr: #1620 |
|||
author: @codecalm |
|||
|
|||
Drop the unused `svgtofont` dependency |
|||
@ -0,0 +1,100 @@ |
|||
name: Release |
|||
|
|||
# On every push to `main` Changesets opens (or updates) the "Version Packages" |
|||
# pull request. Merging it publishes the packages and creates the GitHub release. |
|||
on: |
|||
push: |
|||
branches: [main] |
|||
|
|||
concurrency: ${{ github.workflow }}-${{ github.ref }} |
|||
|
|||
permissions: {} |
|||
|
|||
jobs: |
|||
release: |
|||
if: github.repository == 'tabler/tabler-icons' |
|||
runs-on: ubuntu-latest |
|||
permissions: |
|||
contents: write |
|||
pull-requests: write |
|||
id-token: write |
|||
steps: |
|||
- uses: actions/checkout@v7 |
|||
with: |
|||
fetch-depth: 0 |
|||
|
|||
- name: Use Node.js 22 |
|||
uses: actions/setup-node@v7 |
|||
with: |
|||
node-version: 22 |
|||
registry-url: 'https://registry.npmjs.org' |
|||
|
|||
- uses: pnpm/action-setup@v6 |
|||
name: Install pnpm |
|||
|
|||
# Preview image of the new icons and the PNG/PDF/EPS packages |
|||
- name: Install rsvg-convert |
|||
run: | |
|||
sudo apt-get update |
|||
sudo apt-get install -y --no-install-recommends librsvg2-bin |
|||
|
|||
- name: Get pnpm store directory |
|||
shell: bash |
|||
run: | |
|||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
|||
|
|||
- uses: actions/cache@v6 |
|||
name: Setup pnpm cache |
|||
with: |
|||
path: ${{ env.STORE_PATH }} |
|||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
|||
restore-keys: | |
|||
${{ runner.os }}-pnpm-store- |
|||
|
|||
- name: Install dependencies |
|||
run: pnpm install --frozen-lockfile |
|||
|
|||
# Icons are added without changesets. Generating the changeset for the |
|||
# unreleased ones before the action runs makes any new icon open (or |
|||
# update) the release pull request as a minor release. |
|||
- name: Add changeset for new icons |
|||
run: node ./.build/release-changeset.mjs |
|||
|
|||
- name: Create release pull request or publish |
|||
id: changesets |
|||
uses: changesets/action@v1 |
|||
with: |
|||
version: pnpm run version-packages |
|||
publish: pnpm run release |
|||
title: 'Release' |
|||
commit: 'Release' |
|||
createGithubReleases: false |
|||
env: |
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
|||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
|||
|
|||
# Changesets builds the description from the changelogs only, so the |
|||
# preview of the new icons is put on top of it. The image is loaded from |
|||
# the commit on the release branch, the `v<version>` tag does not exist yet. |
|||
- name: Add new icons preview to the release pull request |
|||
if: steps.changesets.outputs.pullRequestNumber != '' |
|||
env: |
|||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|||
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }} |
|||
run: | |
|||
SHA=$(gh api "repos/${GITHUB_REPOSITORY}/commits/changeset-release/main" --jq .sha) |
|||
git fetch origin changeset-release/main |
|||
git checkout --detach "$SHA" |
|||
node ./.build/release-notes.mjs --image-only --ref "$SHA" > body.md |
|||
gh pr view "$PR_NUMBER" --json body --jq .body >> body.md |
|||
gh pr edit "$PR_NUMBER" --body-file body.md |
|||
|
|||
- name: Create GitHub release |
|||
if: steps.changesets.outputs.published == 'true' |
|||
env: |
|||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|||
run: | |
|||
VERSION=$(node -p "require('./packages/icons/package.json').version") |
|||
node ./.build/release-notes.mjs > notes.md |
|||
gh release create "v${VERSION}" --target "$GITHUB_SHA" --title "Release ${VERSION}" --notes-file notes.md |
|||
File diff suppressed because it is too large
Loading…
Reference in new issue