Skip to content

Commit

Permalink
Closes #3 Adding contribution workflow commands to make it easier to …
Browse files Browse the repository at this point in the history
…minify CSS and SVG files. (#26)
  • Loading branch information
trackleft authored Apr 29, 2022
1 parent 16fef86 commit ad1825a
Show file tree
Hide file tree
Showing 98 changed files with 285 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cdn-deploy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:

- name: Deploy CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 --exclude ".git*" --exclude demo.html . s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/main/
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/main/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/main/*
4 changes: 2 additions & 2 deletions .github/workflows/cdn-deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:

- name: Deploy CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 --exclude ".git*" --exclude demo.html . s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/${{ github.event.inputs.version }}/
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/${{ github.event.inputs.version }}/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/${{ github.event.inputs.version }}/*
- name: Update 'latest' CDN assets to S3 + CloudFront
run: |
aws s3 sync --delete --cache-control max-age=691200 --exclude ".git*" --exclude demo.html . s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/latest/
aws s3 sync --delete --cache-control max-age=691200 dist/. s3://${{ secrets.AZ_DIGITAL_CDN_BUCKET }}/lib/az-icons/latest/
aws cloudfront create-invalidation --distribution-id ${{ secrets.AZ_DIGITAL_CDN }} --paths /lib/az-icons/latest/*
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class
Expand All @@ -21,7 +20,6 @@ dist/

# Maven
target/
dist/

# JetBrains IDE
.idea/
Expand All @@ -47,3 +45,6 @@ Thumbs.db
*.flv
*.mov
*.wmv

### NPM ###
package-lock.json
101 changes: 101 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Contributing

Want to contribute? Any release of Arizona Icons is tested and ready to use, but
additions to the set are in everyone's best interest.

If you want to get involved, you can:

- Request access to join the discussion on Slack ([learn
more]((digital.arizona.edu/arizona-bootstrap/main/docs/0.0/about/get-involved))
- Participate in Friday meetings and Wednesday pull request review sessions (ask
for more details in Slack)
- Submit pull requests on GitHub

Questions, bug reports or suggestions can also be emailed to
[[email protected]](mailto:[email protected]) or
(preferably!) reported on Slack.

## Icon Creation and Generation Process
The icons were designed using vector design software, and the font files were
generated using the [IcoMoon App](https://icomoon.io/app).

### Preparing the Graphics
Before generating the font in IcoMoon, the imported files must be properly
processed first:
- [ ] Use the same sized, square artboard
- [ ] Make sure each graphic is a *compound path* or fill (particularly complex
graphics will need to be a single compound path)\*
- [ ] Save each icon independently as an SVG file

\* *Strokes in the SVG files will be ignored when IcoMoon generates the files
and must be converted to fills and/or compound paths before importing.*


### Generating the Font
Once each icon is saved as its own SVG file, they can be imported to IcoMoon and
mapped to [Unicode's Private Use Area
(PUA)](https://en.wikipedia.org/wiki/Private_Use_Areas) code points. This means
the glyphs will not be associated with any letters or characters which may be
otherwise used symantically.


When new icons are added the font files will need to be regenerated:

- [ ] The original PUA codes need to be matched to their corresponding icons in
IcoMoon (a newly introduced icon will need an unused PUA code specified).
- [ ] Do _not_ change or duplicate the PUA codes connected with each existing
icon (i.e., the icon class `.az-icon-award` is currently mapped to the PUA
code `e901`).
- [ ] Make sure to name the font **az-icons** before clicking IcoMoon App's font
download button (the name can be set by clicking the small gear icon next to
the download button first)
- [ ] Do not use the automatically generated CSS file from IcoMoon, instead only
add the new icon class declaration (the default stylesheet provided by IcoMoon
has been altered to enhance usage).

### Getting your change ready for a pull request.
Add your new files to this repository in the following structure.

```
az-icons
├── demo.html
└── src
├── az-icons-styles.css
├── fonts
│ ├── az-icons.eot
│ ├── az-icons.svg
│ ├── az-icons.ttf
│ └── az-icons.woff
├── png
│ └── *.png
└── svg
└── *.svg
```

Then you should be able to use npm to prepare the new files for distribution.

First install the package dependencies

```
npm install
```

Next use the automated preparation tools to recreate the dist folder.

```
npm run dist
```

See the [package.json](./package.json) for all of the available commands.

## Pull Request Process
1. Create an issue on GitHub with the appropriate [issue type template](https://github.com/az-digital/az-icons/issues/new/choose).
2. Create a branch on the az-icons repository using the issue type naming convention of `<issue-type>/<issue-number>`. Example: `feature/123` or `bug/123`.
3. Make and commit your changes.
4. Create a pull request to be reviewed by the Arizona Digital community. Be sure to include a reference to the issue in your pull request description. Read more about [linking a pull request to an issue](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).

## Policies
Contributions to Arizona Icons must adhere to Arizona Digital's policies and [Code of Conduct](https://github.com/az-digital/policies/blob/main/code-of-conduct.md).

- [Arizona Digital merging policies](https://github.com/az-digital/policies/blob/main/code-of-conduct.md)
- [Arizona Digital Code of Conduct](https://github.com/az-digital/policies/blob/main/code-of-conduct.md)
46 changes: 1 addition & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,50 +43,6 @@ Icons project closely. Please [report bugs to the AZ Digital team](https://githu
Pull the Arizona Icons source files into nearly any project with some of
the most popular package managers.

**npm**
Install Arizona Icons in your Node.js powered apps with npm:
```
npm install https://github.com/az-digital/az-icons
```

Install Arizona Icons in your Node.js powered apps with the yarn package:
```
yarn add https://github.com/az-digital/az-icons
```

## Contributing
### Icon Creation and Generation Process
The icons were designed using vector design software, and the font files were
generated using the [IcoMoon App](https://icomoon.io/app).

### Preparing the Graphics
Before generating the font in IcoMoon, the imported files must be properly
processed first:
- [ ] Use the same sized, square artboard
- [ ] Make sure each graphic is a *compound path* or fill (particularly complex
graphics will need to be a single compound path)\*
- [ ] Save each icon independently as an SVG file

\* *Strokes in the SVG files will be ignored when IcoMoon generates the files
and must be converted to fills and/or compound paths before importing.*

### Generating the Font
Once each icon is saved as its own SVG file, they can be imported to IcoMoon and
mapped to [Unicode's Private Use Area
(PUA)](https://en.wikipedia.org/wiki/Private_Use_Areas) code points. This means
the glyphs will not be associated with any letters or characters which may be
otherwise used semantically.

When new icons are added the font files will need to be regenerated:

- [ ] The original PUA codes need to be matched to their corresponding icons in
IcoMoon (a newly introduced icon will need an unused PUA code specified).
- [ ] Do _not_ change or duplicate the PUA codes connected with each existing
icon (i.e., the icon class `.az-icon-award` is currently mapped to the PUA
code `e901`).
- [ ] Make sure to name the font **az-icons** before clicking IcoMoon App's font
download button (the name can be set by clicking the small gear icon next to
the download button first).
- [ ] Do not use the automatically generated CSS file from IcoMoon, instead only
add the new icon class declaration (the default stylesheet provided by IcoMoon
has been altered to enhance usage).
Please refer to the [Contributing doc](./CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="description" content="An Icon Font Generated By IcoMoon.io">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="demo-files/demo.css">
<link rel="stylesheet" href="az-icons-styles.css"></head>
<link rel="stylesheet" href="dist/az-icons-styles.css"></head>
<body>
<div class="bgc1 clearfix">
<h1 class="mhmm mvm"><span class="fgc1">Font Name:</span> az-icons <small class="fgc1">(Glyphs:&nbsp;20)</small></h1>
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions dist/az-icons-styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
1 change: 1 addition & 0 deletions dist/svg/arizona.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/svg/award.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/svg/cost.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/svg/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/svg/financial-aid.svg
1 change: 1 addition & 0 deletions dist/svg/grad-cap.svg
1 change: 1 addition & 0 deletions dist/svg/instagram.svg
1 change: 1 addition & 0 deletions dist/svg/linkedin.svg
1 change: 1 addition & 0 deletions dist/svg/majors-and-degrees.svg
1 change: 1 addition & 0 deletions dist/svg/map-marker.svg
1 change: 1 addition & 0 deletions dist/svg/pinterest.svg
Loading

0 comments on commit ad1825a

Please sign in to comment.