Skip to content

Commit

Permalink
feat: rewrite generation as a Homebrew command based on the API
Browse files Browse the repository at this point in the history
  • Loading branch information
SMillerDev committed May 28, 2024
1 parent 74fffcb commit f1f5ea4
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 267 deletions.
34 changes: 22 additions & 12 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,35 @@ jobs:
if: github.repository_owner == 'Homebrew' || !github.event.schedule
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: false
cask: false
test-bot: true

- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Ruby 3
uses: ruby/setup-ruby@v1
with:
bundler-cache: true

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- name: Configure git
run: |
git config user.email '[email protected]'
git config user.name 'TANIGUCHI Masaya'
- name: Convert and commit
run: |
git submodule update --init --remote
bundle exec ruby cask2formula convert
bundle exec ruby cask2formula commit
- name: Clean Formula directory
run: |
comm -23 --nocheck-order <(ls -1 Formula) <(basename -a homebrew-cask-fonts/Casks/font/*/*) | xargs -I{} sh -c 'git rm ./Formula/{} && git commit -m "Remove {}"'
- name: Generate formulae
if: github.event_name == 'pull_request'
run: brew generate-linux-fonts --verbose --debug --write-only

- name: Generate and commit formulae
if: github.event_name != 'pull_request'
run: brew generate-linux-fonts --verbose --debug

- name: Publish to GitHub
if: github.event_name != 'pull_request'
env:
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

34 changes: 17 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,35 @@ Making a Font Cask is easy: a Cask is a small Ruby file.

Here’s a Cask for the font [Inconsolata](http://levien.com/type/myfonts/inconsolata.html) as an example:
```ruby
cask 'font-inconsolata' do
cask "font-inconsolata" do
version :latest
sha256 :no_check

url 'http://levien.com/type/myfonts/Inconsolata.otf'
name 'Inconsolata'
homepage 'http://levien.com/type/myfonts/inconsolata.html'
url "http://levien.com/type/myfonts/Inconsolata.otf"
name "Inconsolata"
homepage "http://levien.com/type/myfonts/inconsolata.html"

font 'Inconsolata.otf'
font "Inconsolata.otf"
end
```

Here’s a more complex Cask for the font [Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans). Note that you may repeat the `font` stanza as many times as you need to, if multiple files must be installed from the same package:

```ruby
cask 'font-fantasque-sans-mono' do
version '1.7.1'
sha256 '6bb3b24413b78eed19ffa9bd233ae555982e3b185bd303e57dd1e05bebf17352'
cask "font-fantasque-sans-mono" do
version "1.7.1"
sha256 "6bb3b24413b78eed19ffa9bd233ae555982e3b185bd303e57dd1e05bebf17352"

url "https://github.com/belluzj/fantasque-sans/releases/download/v#{version}/FantasqueSansMono.zip"
appcast 'https://github.com/belluzj/fantasque-sans/releases.atom',
checkpoint: '8085c3dff43a9dbf3201ca790c57800a089d1b69fec91226a600c04d9c681e36'
name 'Fantasque Sans Mono'
homepage 'https://github.com/belluzj/fantasque-sans'

font 'OTF/FantasqueSansMono-Bold.otf'
font 'OTF/FantasqueSansMono-BoldItalic.otf'
font 'OTF/FantasqueSansMono-Italic.otf'
font 'OTF/FantasqueSansMono-Regular.otf'
appcast "https://github.com/belluzj/fantasque-sans/releases.atom",
checkpoint: "8085c3dff43a9dbf3201ca790c57800a089d1b69fec91226a600c04d9c681e36"
name "Fantasque Sans Mono"
homepage "https://github.com/belluzj/fantasque-sans"

font "OTF/FantasqueSansMono-Bold.otf"
font "OTF/FantasqueSansMono-BoldItalic.otf"
font "OTF/FantasqueSansMono-Italic.otf"
font "OTF/FantasqueSansMono-Regular.otf"
end
```

Expand Down
Empty file added Formula/.gitkeep
Empty file.
6 changes: 0 additions & 6 deletions Gemfile

This file was deleted.

16 changes: 0 additions & 16 deletions Gemfile.lock

This file was deleted.

211 changes: 0 additions & 211 deletions cask2formula

This file was deleted.

Loading

0 comments on commit f1f5ea4

Please sign in to comment.