Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 10 additions & 30 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,37 +84,17 @@ jobs:
run: |
gh repo clone nsheaps/homebrew-devsetup homebrew-devsetup

- name: Update formula
- name: Install gomplate
run: |
cd homebrew-devsetup
cat > Formula/git-wt.rb << FORMULA_EOF
# typed: false
# frozen_string_literal: true

class GitWt < Formula
desc 'Interactive TUI for git worktree management'
homepage 'https://github.com/nsheaps/git-wt'
url 'https://github.com/nsheaps/git-wt/archive/refs/tags/${{ steps.release.outputs.tag }}.tar.gz'
sha256 '${{ steps.release.outputs.sha256 }}'
license 'MIT'

head do
url 'https://github.com/nsheaps/git-wt.git', branch: 'main'
end

depends_on 'gum'

def install
bin.install 'bin/git-wt'
end

test do
assert_match 'git-wt', shell_output("#{bin}/git-wt --help")
end
end
FORMULA_EOF
# Remove leading whitespace from heredoc
sed -i 's/^ //' Formula/git-wt.rb
curl -fsSL https://github.com/hairyhenderson/gomplate/releases/latest/download/gomplate_linux-amd64 -o /usr/local/bin/gomplate
chmod +x /usr/local/bin/gomplate

- name: Generate formula from template
env:
Tag: ${{ steps.release.outputs.tag }}
SHA256: ${{ steps.release.outputs.sha256 }}
run: |
gomplate -f Formula/git-wt.rb.gotmpl -o homebrew-devsetup/Formula/git-wt.rb

- name: Create PR to update formula with auto-merge
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup mise
uses: jdx/mise-action@v2
Expand Down
14 changes: 14 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
AllCops:
NewCops: enable
Metrics/BlockLength:
Enabled: false
Layout/LineLength:
AllowedPatterns:
- "# renovate: .*"
Naming/FileName:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/Documentation:
Enabled: false
24 changes: 24 additions & 0 deletions Formula/git-wt.rb.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# typed: false
# frozen_string_literal: true

class GitWt < Formula
desc 'Interactive TUI for git worktree management'
homepage 'https://github.com/nsheaps/git-wt'
url 'https://github.com/nsheaps/git-wt/archive/refs/tags/{{ .Env.Tag }}.tar.gz'
sha256 '{{ .Env.SHA256 }}'
license 'MIT'

head do
url 'https://github.com/nsheaps/git-wt.git', branch: 'main'
end

depends_on 'gum'

def install
bin.install 'bin/git-wt'
end

test do
assert_match 'git-wt', shell_output("#{bin}/git-wt --help")
end
end