Skip to content

Commit

Permalink
Minor improvements (simple-icons#4708)
Browse files Browse the repository at this point in the history
* Remove .travis.yml reference from .gitattributes

* Minor refactoring of .svglintrc.js

- Remove unused variables
- Fix missing semi-colons
- Remove unneeded indentation

* Prevent error in clean command due to missing files

* Fix indentations

* Further improvements to Editorconfig and indentation

* Format YAML files

- Update indentation for array notation
- Normalize use of newlines
  • Loading branch information
ericcornelissen authored Jan 15, 2021
1 parent 8fc59f0 commit a4ca746
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 187 deletions.
14 changes: 7 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ root=true

[*]
charset=utf-8
indent_size=2
indent_style=space
insert_final_newline=true
trim_trailing_whitespace=true

[LICENSE.md]
[*.md]
indent_size=unset
indent_style=space

[*.{json,yml}]
indent_size=2
indent_style=space

[*.svg]
insert_final_newline=false
Expand All @@ -20,4 +18,6 @@ trim_trailing_whitespace=false # Templates with trailing whitespace are more usa

[_data/simple-icons.json]
indent_size=4
trim_trailing_whitespace=true

[index.html]
indent_size=4
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ Gemfile.lock -diff
# Don't export/archive these files
.github export-ignore
.gitpod.yml export-ignore
.travis.yml export-ignore
CNAME export-ignore
8 changes: 4 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
new icon:
- any: [icons/*.svg]
status: 'added'
- any: [icons/*.svg]
status: added
icon outdated:
- any: [icons/*.svg]
status: 'modified'
- any: [icons/*.svg]
status: modified
6 changes: 3 additions & 3 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: ericcornelissen/labeler@label-based-on-status
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ericcornelissen/labeler@label-based-on-status
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: simple-icons/release-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: simple-icons/release-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .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
with:
repo-token: ${{ secrets.RELEASE_TOKEN }}
- uses: simple-icons/release-action@master
with:
repo-token: ${{ secrets.RELEASE_TOKEN }}
128 changes: 64 additions & 64 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,82 @@ name: Publish
on:
push:
branches:
- master
- master

jobs:
npm:
name: NPM Package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Sanity check
run: |
npm run lint
npm run test
- name: Deploy to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Sanity check
run: |
npm run lint
npm run test
- name: Deploy to NPM
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
github:
name: GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Sanity check
run: |
npm run lint
npm run test
- name: Get commit message (for release title and body)
id: commit
uses: kceb/git-message-action@v1
- name: Get release title and body
id: release
run: |
COMMIT_MSG="$(echo "${{ steps.commit.outputs.git-message }}")"
RELEASE_TITLE="$(echo "$COMMIT_MSG" | head -n 1)"
echo "::set-output name=title::$RELEASE_TITLE"
RELEASE_BODY="$(echo "$COMMIT_MSG" | tail -n +3)"
echo "::set-output name=body::$RELEASE_BODY"
- 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: Create and push git tag
uses: actions-ecosystem/action-push-tag@v1
with:
tag: ${{ steps.get-version.outputs.version }}
message: ${{ steps.commit.outputs.git-message }}
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-version.outputs.version }}
release_name: ${{ steps.release.outputs.title }}
body: ${{ steps.release.outputs.body }}
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Sanity check
run: |
npm run lint
npm run test
- name: Get commit message (for release title and body)
id: commit
uses: kceb/git-message-action@v1
- name: Get release title and body
id: release
run: |
COMMIT_MSG="$(echo "${{ steps.commit.outputs.git-message }}")"
RELEASE_TITLE="$(echo "$COMMIT_MSG" | head -n 1)"
echo "::set-output name=title::$RELEASE_TITLE"
RELEASE_BODY="$(echo "$COMMIT_MSG" | tail -n +3)"
echo "::set-output name=body::$RELEASE_BODY"
- 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: Create and push git tag
uses: actions-ecosystem/action-push-tag@v1
with:
tag: ${{ steps.get-version.outputs.version }}
message: ${{ steps.commit.outputs.git-message }}
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-version.outputs.version }}
release_name: ${{ steps.release.outputs.title }}
body: ${{ steps.release.outputs.body }}
font:
name: Trigger simple-icons-font release
needs: npm
runs-on: ubuntu-latest
steps:
- name: Trigger simple-icons-font release
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.SIMPLE_ICONS_FONT_TOKEN }}" \
-d '{"ref":"develop"}' \
https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches
- name: Trigger simple-icons-font release
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.SIMPLE_ICONS_FONT_TOKEN }}" \
-d '{"ref":"develop"}' \
https://api.github.com/repos/simple-icons/simple-icons-font/actions/workflows/auto-release.yml/dispatches
2 changes: 0 additions & 2 deletions .github/workflows/remove-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
out of scope
pending
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)
Expand All @@ -37,7 +36,6 @@ jobs:
labels: |
in discussion
pending
remove-closed-issue-labels:
name: Remove closed issue labels
if: github.event.issue.state == 'closed'
Expand Down
68 changes: 34 additions & 34 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,45 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run linter
run: |
npm run jsonlint
npm run svglint
npm run wslint
npm run our-lint
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run linter
run: |
npm run jsonlint
npm run svglint
npm run wslint
npm run our-lint
build:
name: Build website
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# https://github.com/ruby/setup-ruby/blob/master/README.md#caching-bundle-install-automatically
bundler-cache: true
- name: Build website
run: bundle exec jekyll build
- name: Checkout
uses: actions/checkout@v2
- name: Use Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# https://github.com/ruby/setup-ruby/blob/master/README.md#caching-bundle-install-automatically
bundler-cache: true
- name: Build website
run: bundle exec jekyll build
test:
name: Test package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
62 changes: 31 additions & 31 deletions .jsonlintschema
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"title": "Simple Icons",
"type": "object",
"properties": {
"icons": {
"description": "The list of icons",
"type": "array",
"items": {
"description": "A single icon",
"type": "object",
"properties": {
"title": {
"description": "The icons name",
"type": "string",
"required": true
},
"hex": {
"description": "The icons color, as HEX (without #)",
"type": "string",
"pattern": "^[0-9A-F]{6}$",
"required": true
},
"source": {
"description": "The website from which the icon originated",
"type": "string",
"pattern": "^https?://[^\\s]+$",
"required": true
}
},
"required": true
}
}
"title": "Simple Icons",
"type": "object",
"properties": {
"icons": {
"description": "The list of icons",
"type": "array",
"items": {
"description": "A single icon",
"type": "object",
"properties": {
"title": {
"description": "The icons name",
"type": "string",
"required": true
},
"hex": {
"description": "The icons color, as HEX (without #)",
"type": "string",
"pattern": "^[0-9A-F]{6}$",
"required": true
},
"source": {
"description": "The website from which the icon originated",
"type": "string",
"pattern": "^https?://[^\\s]+$",
"required": true
}
},
"required": true
}
}
}
}
Loading

0 comments on commit a4ca746

Please sign in to comment.