Skip to content

Commit

Permalink
chore: initialize project
Browse files Browse the repository at this point in the history
  • Loading branch information
fang2hou committed Aug 4, 2024
0 parents commit be1d5cb
Show file tree
Hide file tree
Showing 12 changed files with 410 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: fang2hou
patreon: fang2hou
ko_fi: fang2hou
custom: ["http://paypal.me/fang2h0u", "https://afdian.net/@fang2hou"]
20 changes: 20 additions & 0 deletions .github/workflows/auto-assign.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 🤖 Auto Assign
on:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened]
jobs:
run:
name: 👦🏻 Assign
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Assign
uses: pozil/auto-assign-issue@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
assignees: ${{ vars.DEFAULT_ASSIGNEE }}
numOfAssignee: 1
41 changes: 41 additions & 0 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 🚀 Release
on:
push:
tags:
- 'v*'
jobs:
tag-check:
name: 🏷️ Tag Check
runs-on: ubuntu-latest
steps:
- name: Check tag
run: echo "${{ github.ref_name }}" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+(\.[0-9]+)?)?$'
check:
name: 🧐 Pre-release check
runs-on: ubuntu-latest
needs: tag-check
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup toolchain
run: rustup component add clippy rustfmt
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Lint
run: cargo clippy --verbose
- name: Format check
run: cargo fmt -- --check
release:
name: 🆕 New release
runs-on: ubuntu-latest
needs: check
steps:
- name: Create release via GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_PERSONAL_ACCESS_TOKEN }}
tag: ${{ github.ref_name }}
run: gh release create "$tag" --repo="$GITHUB_REPOSITORY" --title="${GITHUB_REPOSITORY#*/} v${tag#v}" --generate-notes
51 changes: 51 additions & 0 deletions .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 🏗️ Release Build
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: 🧐 Pre-build check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup toolchain
run: rustup component add clippy rustfmt
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Lint
run: cargo clippy --verbose
- name: Format check
run: cargo fmt -- --check
build:
name: 🏗️ Build ${{ matrix.target }}
runs-on: ubuntu-latest
needs: check
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz
- target: x86_64-apple-darwin
archive: zip
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compile
uses: rust-build/rust-build.action@v1.4.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
EXTRA_FILES: 'README.md LICENSE'
23 changes: 23 additions & 0 deletions .github/workflows/release-notify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 📢 Release Notify
on:
release:
types: [published]
jobs:
notify:
name: 📢 Notify
runs-on: ubuntu-latest
steps:
- name: Checkout to actions repository
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: wind-addons/actions
ref: main
- name: Send message to Discord
env:
RELEASE_EVENT_JSON: ${{ toJson(github.event.release) }}
REPOSITORY_NAME: ${{ github.repository }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_ALL_RELEASE }}
BAR_IMAGE: ${{ vars.DISCORD_MESSAGE_BAR_IMAGE }}
ROCKET_IMAGE: ${{ vars.DISCORD_MESSAGE_ROCKET_IMAGE }}
run: node discord/release-message.js
25 changes: 25 additions & 0 deletions .github/workflows/rust-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 🦀 Rust
on:
push:
branches: ["main", "master"]
pull_request:
types: [opened, synchronize, reopened]
jobs:
check:
name: 🧐 Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup toolchain
run: rustup component add clippy rustfmt
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
- name: Lint
run: cargo clippy --verbose
- name: Format check
run: cargo fmt -- --check
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# IDEs
.idea
.vscode
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "flemoji"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "flemoji"
path = "src/bin/flemoji.rs"

[dependencies]
image = "0.25.2"
walkdir = "2.5.0"
rayon = "1.10.0"
clap = { version = "4.5.13", features = ["derive"] }
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Wind Addons

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ✨ flemoji

A simple tool to customize Microsoft Fluent UI emojis with given size and type written in Rust.

<details>
<summary>📖 Table of Contents</summary>

- [🚚 Installation](#-installation)
- [💡 Usage](#-usage)
- [Help](#help)
- [Example](#example)
- [📜 License](#-license)

</details>

## 🚚 Installation

```bash
cargo install --git https://github.com/wind-addons/flemoji
```

## 💡 Usage

### Help

```text
flemoji - Customize Microsoft Fluent UI emoji images.
Usage: flemoji.exe [OPTIONS] --width <WIDTH> --height <HEIGHT> --from <DIR> --to <DIR>
Options:
-W, --width <WIDTH> Sets the width of the output images
-H, --height <HEIGHT> Sets the height of the output images
--from <DIR> Sets the input directory (assets)
--to <DIR> Sets the output directory
-T, --filetype <FILETYPE> Sets the output file type (png, jpg, etc.) [default: png]
-h, --help Print help
-V, --version Print version
```

### Example

```bash
flemoji --width 64 --height 64 --from ./assets --to ./output --type png
```

## 📜 License

MIT
Loading

0 comments on commit be1d5cb

Please sign in to comment.