Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into pr/7399
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Rusted committed Aug 15, 2023
2 parents f0dc1a0 + 7c181a3 commit 968e703
Show file tree
Hide file tree
Showing 612 changed files with 6,174 additions and 2,011 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ node_modules/
npm-debug.log

# Build files
icons/*.js
/index.js
/index.mjs
/index.d.ts
/sdk.js
13 changes: 5 additions & 8 deletions .github/ISSUE_TEMPLATE/icon_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ body:
attributes:
label: Popularity Metric
description: >-
Provide either a [Similarweb rank] or the number of GitHub stars. If
Similarweb does not have a rank for your brand or the rank fails to meet our
requirements, we can also accept an [Alexa rank] as an alternative. If these
are not available or too low you can still open the issue. In this case,
please provide any information regarding the brand's popularity you think is
relevant.
Provide either a [Similarweb rank], which must range from 0-500,000 to qualify
or the number of GitHub stars, which must be above 5,000 to qualify. If
Similarweb does not have a rank for your brand or these numbers do not meet
our requirements, you can still open the issue. In this case, please provide
any information regarding the brand's popularity you think is relevant.
[Similarweb rank]: https://www.similarweb.com
[Alexa rank]: https://www.alexa.com/siteinfo
placeholder: 'Example: The Similarweb rank is 261,758. See https://www.similarweb.com/website/simpleicons.org'
validations:
required: true
Expand Down
3 changes: 3 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@

// We generally always want the major version
separateMajorMinor: false,

// We manually update digest dependencies (eg. hashes in Github actions)
digest: { enabled: false },
}
8 changes: 4 additions & 4 deletions .github/workflows/add-labels-priority.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
name: Get labels
run: |
labels="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/pulls/${{ github.event.pull_request.number }} | jq '.labels[].name' | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "::set-output name=labels::$labels"
echo "labels=$labels" >> $GITHUB_OUTPUT
- id: get-si-members
name: Get simple-icons members
run: |
members="$(curl --retry 5 -s https://api.github.com/orgs/simple-icons/members | jq .[].login | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "::set-output name=members::$members"
members="$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_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
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
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.actor.login) == false
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
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/autoclose-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Autocloser
on:
issues:
# we allow 'reopend' and 'edited' in case the issue was closed by accident
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- id: match-title
name: Match title
# if the title contains the word Java (case insensitive)
# we make sure that this word is the end of the string or is followed by a space character (ex. we do not want to match javascript)
# we make sure that this word is the beginning of the string or is preceded by a space character (ex. we do not want to match foojava)
run: |
if [[ "${{ github.event.issue.title }}" =~ (^|[[:space:]])([jJ][aA][vV][aA])([[:space:]]|$) ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- id: get-labels
name: Get labels
run: |
labels="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/issues/${{ github.event.issue.number }} | jq '.labels[].name' | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "labels=$labels" >> $GITHUB_OUTPUT
# if the issue is labeled as a 'new icon' and it matches Java, we
# - add a comment referring to the removal request
# - we add the 'duplicate' label
# - we close the issue
- name: Close the issue
if: |
steps.match-title.outputs.match == 'true' &&
contains(steps.get-labels.outputs.labels, 'new icon')
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This issue was automatically closed. Please refer to #7374.'
})
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['duplicate']
})
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
state_reason: 'not_planned'
});
23 changes: 20 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
did-create-pr: ${{ steps.release.outputs.did-create-pr }}
new-version: ${{ steps.release.outputs.new-version }}
steps:
- uses: simple-icons/release-action@master
- uses: LitoMore/simple-icons-release-action@9969e1266c9e470fe015dbd825a2897423e9270e
id: release
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -41,16 +41,33 @@ jobs:
token: ${{ secrets.RELEASE_TOKEN }}
# Ensure we are checked out on the develop branch
ref: develop
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Bump version
run: node ./scripts/release/bump-version.js "${{ needs.release-pr.outputs.new-version }}"
run: |
npm version --no-commit-hooks --no-git-tag-version \
"${{ needs.release-pr.outputs.new-version }}"
- name: Install dependencies
run: npm i
- 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@v4.14.1
uses: stefanzweifel/git-auto-commit-action@v4.16.0
with:
commit_message: version bump
commit_user_name: 'github-actions[bot]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'release')
steps:
- uses: simple-icons/release-action@master
- uses: simple-icons/release-action@v1
with:
repo-token: ${{ secrets.RELEASE_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/potential-duplicates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
requesting
request
project
updated
outdated
brand
assets
for
from
state: all
threshold: 0.7
comment: |
Expand Down
26 changes: 12 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Remove dark theme images from README
uses: mondeja/strip-gh-theme-links@v3
with:
files: README.md
strict: true
- name: Install dependencies
run: npm i
- name: Replace CDN theme image links from README
run: npm run strip-theme-link
- name: Update SDK Typescript definitions
run: node ./scripts/release/update-sdk-ts-defs.js
- name: Build NodeJS package
run: npm run build
- name: Deploy to NPM
uses: JS-DevTools/npm-publish@v1
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
github:
Expand All @@ -68,26 +69,23 @@ jobs:
uses: actions/checkout@v3
- name: Get commit message (for release title and body)
id: commit
uses: kceb/git-message-action@v1
uses: kceb/git-message-action@v2
- name: Get release version
id: get-version
run: |
export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//')
echo "::set-output name=version::$PACKAGE_VERSION"
- name: Remove dark theme images from README
uses: mondeja/strip-gh-theme-links@v3
with:
files: README.md
strict: true
- name: Replace CDN theme image links from README
run: npm run strip-theme-link
- name: Configure GIT credentials
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# Commit that will only be included in the tag
- name: Commit dark theme images strip
- name: Commit CDN theme image links removal
run: |
git add README.md
git commit -m 'Strip README dark theme image links'
git commit -m 'Replace README CDN theme image links'
- name: Create and push git tag
run: |
set -e
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ jobs:
run: npm i
- name: Run linter
run: npm run lint
- name: Detect changed documentation files
uses: dorny/paths-filter@v2
id: changes
with:
list-files: shell
filters: |
docs:
- '*.md'
- '.github/**.md'
- name: Check documentation links
if: steps.changes.outputs.docs == 'true'
run: |
npx markdown-link-check --retry \
${{ steps.changes.outputs.docs_files }}
continue-on-error: ${{ github.ref == 'refs/heads/develop' }}
- name: Verify file permissions
run: |
CHECK_DIRS="icons/ _data/"
Expand Down
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Editor configurations
.vscode
.idea

# Files generated by build script
/index.js
/icons.js
/icons.mjs
/icons.d.ts
/index.mjs
/index.d.ts
/sdk.js

# Ignore all files in the icons folder
icons/*
Expand All @@ -22,6 +26,8 @@ yarn.lock
# Dependency directories
node_modules/

# Generated files
*.tgz

### macOS ###
# General
Expand Down
Loading

0 comments on commit 968e703

Please sign in to comment.