Convert simple-icons manual backup from submodule to tracked files

This commit is contained in:
MayaChat
2025-11-24 14:51:23 -05:00
parent 30bbe7a0a4
commit f363db5e47
3467 changed files with 42987 additions and 1 deletions

View File

@@ -0,0 +1,160 @@
name: Add Pull Request Labels and Assign to Project
on:
pull_request_target:
types: [opened, closed]
jobs:
add-labels:
permissions:
contents: read
pull-requests: write
issues: write
runs-on: ubuntu-latest
if: |
github.event.action == 'opened' &&
github.event.pull_request.base.ref != 'master'
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: simple-icons/labeler@v1
with:
repo-token: ${{ steps.app-token.outputs.token }}
# TODO: The next job has been temporarily disabled until the maintainers
# team decide to use projects board again.
# assign-to-project:
# runs-on: ubuntu-latest
# name: Assign to Project
# if: |
# github.event.action == 'opened' &&
# github.event.pull_request.base.ref != 'master'
# needs: add-labels
# steps:
# - uses: actions/create-github-app-token@v1
# id: app-token
# with:
# app-id: ${{ vars.BOT_APP_ID }}
# private-key: ${{ secrets.BOT_PRIVATE_KEY }}
# - name: Checkout
# uses: actions/checkout@v5
# - id: get-labels
# uses: ./.github/actions/get-labels
# with:
# issue_number: ${{ github.event.pull_request.number }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# - id: get-si-members
# name: Get simple-icons members
# run: |
# members="$(curl -H 'Authorization: Bearer ${{ steps.app-token.outputs.token }}' --retry 5 -s https://api.github.com/orgs/simple-icons/members | jq .[].login | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
# echo "members=$members" >> $GITHUB_OUTPUT
# - id: get-linked-issues
# name: Get linked issue numbers
# uses: mondeja/pr-linked-issues-action@v2
# with:
# # Lazy linked issues. If one of the lines of the pull request body
# # matches one of the next contents, the matching issue number will
# # be added to `issues` output:
# add_links_by_content: |
# **Issue:** #{issue_number}
# **Issue**: #{issue_number}
# **Close:** #{issue_number}
# **Close**: #{issue_number}
# **Closes:** #{issue_number}
# **Closes**: #{issue_number}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - id: priority-1
# name: Assign `update icon/data` pull requests to "Priority 1"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# if: contains(steps.get-labels.outputs.labels, 'update icon/data')
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Priority 1
# - id: priority-2
# name: Assign `new icon` pull requests to "Priority 2"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# # the PR has the `new icon` label along with a linked issue and
# # the opener is not a member of simple-icons organization
# if: |
# contains(steps.get-labels.outputs.labels, 'new icon') &&
# join(steps.get-linked-issues.outputs.issues) != '' &&
# contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == false
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Priority 2
# - id: priority-3
# name: Assign `new icon` pull requests by maintainers to "Priority 3"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# # the PR has the `new icon` label along with a linked issue and
# # the opener is a member of the simple-icons organisation
# if: |
# contains(steps.get-labels.outputs.labels, 'new icon') &&
# join(steps.get-linked-issues.outputs.issues) != '' &&
# contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == true
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Priority 3
# - id: priority-4
# name: Assign `new icon` pull requests by maintainers without an issue to "Priority 4"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# # the PR has the `new icon` label but with no linked issue and
# # the opener is a member of the simple-icons organisation
# if: |
# contains(steps.get-labels.outputs.labels, 'new icon') &&
# join(steps.get-linked-issues.outputs.issues) == '' &&
# contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == true
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Priority 4
# - name: Assign pull requests to "Unprioritised"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# if: |
# steps.priority-1.conclusion == 'skipped' &&
# steps.priority-2.conclusion == 'skipped' &&
# steps.priority-3.conclusion == 'skipped' &&
# steps.priority-4.conclusion == 'skipped'
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Unprioritised
# unassign-from-project:
# runs-on: ubuntu-latest
# name: Unassign from Project
# if: |
# github.event.action != 'opened' &&
# github.event.pull_request.merged == false &&
# github.event.pull_request.base.ref != 'master'
# steps:
# - uses: actions/create-github-app-token@v1
# id: app-token
# with:
# app-id: ${{ vars.BOT_APP_ID }}
# private-key: ${{ secrets.BOT_PRIVATE_KEY }}
# - name: Assign closed pull requests to "Completed or Abandoned"
# uses: srggrs/assign-one-project-github-action@1.3.1
# env:
# MY_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
# with:
# project: https://github.com/orgs/simple-icons/projects/2
# column_name: Completed or Abandoned

View File

@@ -0,0 +1,23 @@
name: Autocloser
on:
issues:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v5
- name: Autoclose Issues
run: node scripts/autoclose-issues/autoclose.app.js
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
ISSUE_NUMBER: ${{ github.event.issue.number }}

View File

@@ -0,0 +1,101 @@
name: Create Release Pull Request
on:
# THIS WORKFLOW SHOULD NEVER BE TRIGGERED ON A PUSH EVENT. IF TRIGGERED ON A
# PUSH EVENT IT MAY CREATE AN ENDLESS STREAM OF 'version bump' COMMITS.
workflow_dispatch:
schedule:
# "At 00:00 on Sunday" (https://crontab.guru/once-a-week)
- cron: '0 0 * * 0'
# This Workflow can be triggered manually through the GitHub UI or API. For the
# API use the following request:
# curl -X POST \
# -H "Authorization: Bearer <token>" \
# -d '{"ref":"develop"}' \
# https://api.github.com/repos/simple-icons/simple-icons/actions/workflows/create-release.yml/dispatches
# Replacing <token> by a personal access token with scope `public_repo`
jobs:
check-is-fork:
name: Check if running in a fork
runs-on: ubuntu-latest
permissions: {}
outputs:
is-fork: ${{ steps.check.outputs.is-fork }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/check-is-fork
id: check
with:
in-fork-message: 'Create Release Pull Request workflow only can run in the main repository, skipping.'
release-pr:
runs-on: ubuntu-latest
needs: check-is-fork
permissions:
contents: read
pull-requests: write
issues: write
if: |
github.event_name != 'push' &&
needs.check-is-fork.outputs.is-fork != 'true'
outputs:
did-create-pr: ${{ steps.release.outputs.did-create-pr }}
new-version: ${{ steps.release.outputs.new-version }}
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: simple-icons/release-action@v3
id: release
with:
repo-token: ${{ steps.app-token.outputs.token }}
version-bump:
runs-on: ubuntu-latest
needs: release-pr
permissions:
contents: write
if: |
github.event_name != 'push' &&
needs.release-pr.outputs.did-create-pr == 'true'
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v5
with:
# Ensure the commit can be pushed regardless of branch protections (must belong to an admin of this repo)
token: ${{ steps.app-token.outputs.token }}
# Ensure we are checked out on the develop branch
ref: develop
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Bump version
run: |
npm version --no-commit-hooks --no-git-tag-version \
"${{ needs.release-pr.outputs.new-version }}"
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Update major version in CDN URLs
run: node scripts/release/update-cdn-urls.js
- name: Update SVGs count milestone
run: node scripts/release/update-svgs-count.js
- name: Update slugs table
run: node scripts/release/update-slugs-table.js
- name: Update SDK Typescript definitions
run: node scripts/release/update-sdk-ts-defs.js
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: Bump version
commit_user_name: 'simple-icons[bot]'
commit_user_email: 'simple-icons[bot]@users.noreply.github.com'
commit_author: 'simple-icons[bot] <simple-icons[bot]@users.noreply.github.com>'

View File

@@ -0,0 +1,20 @@
name: Merge Release Pull Request
on:
pull_request_review:
types: [submitted]
jobs:
release:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'release')
permissions:
pull-requests: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: simple-icons/release-action@v3
with:
repo-token: ${{ steps.app-token.outputs.token }}

View File

@@ -0,0 +1,149 @@
name: Publish Releases
on:
push:
branches:
- master
jobs:
sanity-check:
name: Pre-publish checks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Run linters
run: npm run lint
- name: Build NodeJS package
run: npm run build
- name: Run tests
run: npm run test
npm:
name: NPM Package
needs: sanity-check
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # for OIDC authentication
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- id: get-version
uses: ./.github/actions/get-version
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Reformat to regular markdown
run: node scripts/release/reformat-markdown.js "${{ steps.get-version.outputs.version }}"
- name: Update SDK Typescript definitions
run: node scripts/release/update-sdk-ts-defs.js
- name: Minify icons data file
run: node scripts/release/minify-icons-data.js
- name: Build NodeJS package
run: npm run build
- name: Deploy to NPM
run: npm publish
github:
name: GitHub release
needs: sanity-check
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v5
- name: Get commit message (for release title and body)
id: commit
uses: kceb/git-message-action@v3
- id: get-version
uses: ./.github/actions/get-version
- name: Reformat to regular markdown
run: node scripts/release/reformat-markdown.js "${{ steps.get-version.outputs.version }}"
- name: Configure GIT credentials
run: |
git config user.name "simple-icons[bot]"
git config user.email "simple-icons[bot]@users.noreply.github.com"
# Commit that will only be included in the tag
- name: Commit CDN theme image links removal
run: |
git add README.md
git commit -m 'Replace README CDN theme image links'
- name: Create and push git tag
run: |
set -e
tag="${{ steps.get-version.outputs.version }}"
git tag -a "${tag}" -m "$GIT_MESSAGE"
git push origin "${tag}"
env:
GIT_MESSAGE: ${{ steps.commit.outputs.git-message }}
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
with:
tag_name: ${{ steps.get-version.outputs.version }}
name: ${{ steps.commit.outputs.title }}
body: ${{ steps.commit.outputs.body }}
- name: Send release to Discord
run: node scripts/release/discord-release-message.js "${{ steps.get-version.outputs.version }}"
env:
DISCORD_RELEASES_ROLE_ID: ${{ secrets.DISCORD_RELEASES_ROLE_ID }}
DISCORD_RELEASES_WEBHOOK_URL: ${{ secrets.DISCORD_RELEASES_WEBHOOK_URL }}
continue-on-error: true
font:
name: Trigger simple-icons-font release
needs: npm
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
repositories: 'simple-icons-font'
- name: Trigger simple-icons-font release
run: |
curl -X POST \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
-d '{"ref":"develop"}' \
https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches
website:
name: Trigger simpleicons.org website update
needs: npm
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
repositories: 'simple-icons-website-rs'
- name: Trigger simpleicons.org website update
run: |
curl -X POST \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
-d '{"ref":"master"}' \
https://api.github.com/repos/simple-icons/simple-icons-website-rs/actions/workflows/auto-release.yml/dispatches

View File

@@ -0,0 +1,79 @@
name: Remove Outdated Labels
on:
pull_request_target:
types:
- closed
issues:
types:
- closed
permissions:
issues: write
pull-requests: write
jobs:
remove-merged-pr-labels:
name: Remove merged pull request labels
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ steps.app-token.outputs.token }}
labels: |
assessing
awaiting reply
duplicate
in discussion
invalid
out of scope
pending
permission in review
permission required
won't add
remove-closed-pr-labels:
name: Remove closed pull request labels
if: |
github.event_name == 'pull_request_target' &&
(!github.event.pull_request.merged)
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ steps.app-token.outputs.token }}
labels: |
in discussion
pending
assessing
permission in review
remove-closed-issue-labels:
name: Remove closed issue labels
if: github.event.issue.state == 'closed'
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- uses: mondeja/remove-labels-gh-action@v2
with:
token: ${{ steps.app-token.outputs.token }}
labels: |
in discussion
pending
assessing
permission in review

View File

@@ -0,0 +1,50 @@
name: Renovate
on:
schedule:
- cron: '0 0 1 5,11 *'
workflow_dispatch:
jobs:
check-is-fork:
name: Check if running in a fork
runs-on: ubuntu-latest
permissions: {}
outputs:
is-fork: ${{ steps.check.outputs.is-fork }}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/check-is-fork
id: check
with:
in-fork-message: 'Renovate workflow only can run in the main repository, skipping.'
renovate:
runs-on: ubuntu-latest
needs: check-is-fork
if: needs.check-is-fork.outputs.is-fork != 'true'
timeout-minutes: 15
permissions:
contents: write
issues: write
pull-requests: write
checks: write
statuses: write
steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v5
- name: Setup node
uses: actions/setup-node@v6
with:
node-version-file: .node-version
- name: Renovate
uses: renovatebot/github-action@v43.0.19
with:
configurationFile: .github/renovate.json5
token: ${{ steps.app-token.outputs.token }}
env:
LOG_LEVEL: debug

View File

@@ -0,0 +1,124 @@
name: Verify Source
on:
pull_request:
push:
branches:
- master
- develop
jobs:
build:
name: Build package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Build NodeJS package
run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Is normal pull request
# check if is not a release pull request
id: pr
run: echo "is_normal=$(echo ${{ github.base_ref != 'master' && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'meta') == false }})" >> $GITHUB_OUTPUT
- name: Detect changed files
uses: dorny/paths-filter@v3
id: changes
with:
list-files: shell
filters: |
docs:
- '*!(slugs).md'
- '.github/**.md'
icons:
- 'icons/*.svg'
slugs:
- 'slugs.md'
sdkts:
- 'sdk.d.ts'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Don't edit slugs.md in pull requests
if: steps.pr.outputs.is_normal == 'true' && steps.changes.outputs.slugs == 'true'
run: |
echo -ne "Detected slugs.md file edition in PR.\n" 1>&2
echo -ne "Please revert it, we build the slugs.md" 1>&2
echo -ne " file automatically at releases.\n" 1>&2
exit 1
- name: Don't edit sdk.d.ts in pull requests
if: steps.pr.outputs.is_normal == 'true' && steps.changes.outputs.sdkts == 'true'
run: |
echo -ne "Detected sdk.d.ts file edition in PR.\n" 1>&2
echo -ne "Please revert it, we build the sdk.d.ts" 1>&2
echo -ne " file automatically at releases.\n" 1>&2
exit 1
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Prepare icons
if: steps.pr.outputs.is_normal == 'true' && steps.changes.outputs.icons == 'true'
run: sed -i 's/\\"icons\/\*\.svg\\"/$npm_config_icons/' package.json
- name: Prepare docs (docs changed)
# only lint changed docs
if: steps.pr.outputs.is_normal == 'true' && steps.changes.outputs.docs == 'true'
run: sed -i "s/'\*\*\/\*\.md'/"'$npm_config_docs'"/" package.json
- name: Prepare docs (no docs changed)
# only lint README.md if no changes in docs
if: steps.pr.outputs.is_normal == 'true' && steps.changes.outputs.docs != 'true'
run: sed -i "s/'\*\*\/\*\.md'/README.md/" package.json
- name: Run linter
run: npm run lint --icons="$ICONS_FILES" --docs="$DOCS_FILES"
env:
ICONS_FILES: ${{ steps.changes.outputs.icons_files }}
DOCS_FILES: ${{ steps.changes.outputs.docs_files }}
# Authorise GitHub API requests for editorconfig-checker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check documentation links
if: steps.changes.outputs.docs == 'true'
uses: lycheeverse/lychee-action@v2
with:
args: -- ${{ steps.changes.outputs.docs_files }}
fail: ${{ github.ref != 'refs/heads/develop' }}
failIfEmpty: false
jobSummary: true
format: markdown
token: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci --no-audit --no-fund
- name: Run tests
run: npm run test