mirror of
https://github.com/lukaszraczylo/lolcathost.git
synced 2026-11-19 09:35:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c022fa0d2 | ||
|
|
5d8c72d75f | ||
|
|
2a6f0ee244 | ||
|
|
99f215cb7c | ||
|
|
6eb634bfd0 | ||
|
|
4bf0dd2cdf | ||
|
|
70ac227613 |
@@ -1,61 +1,17 @@
|
|||||||
name: AutoUpdate
|
name: Autoupdate go.mod and go.sum
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 3 * * *"
|
- cron: "0 3 * * *"
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
actions: write
|
actions: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
autoupdate:
|
||||||
runs-on: ubuntu-latest
|
uses: lukaszraczylo/shared-actions/.github/workflows/go-autoupdate.yaml@main
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
with:
|
||||||
go-version: "1.24"
|
go-version: "1.24"
|
||||||
cache: true
|
release-workflow: "release.yml"
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: go get ./...
|
|
||||||
|
|
||||||
test:
|
|
||||||
needs: prepare
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: golang:1
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: apt-get update && apt-get install -y ca-certificates make
|
|
||||||
|
|
||||||
- name: Tidy and update modules
|
|
||||||
run: |
|
|
||||||
go mod tidy
|
|
||||||
go get -u -v ./...
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: CI_RUN=${CI} go test -v ./...
|
|
||||||
|
|
||||||
- name: Configure git safe directory
|
|
||||||
run: git config --global --add safe.directory /__w/lolcathost/lolcathost
|
|
||||||
|
|
||||||
- name: Commit changes
|
|
||||||
id: auto-commit
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
|
||||||
with:
|
|
||||||
commit_message: "Update go.mod and go.sum"
|
|
||||||
file_pattern: "go.mod go.sum"
|
|
||||||
|
|
||||||
- name: Trigger release workflow
|
|
||||||
if: steps.auto-commit.outputs.changes_detected == 'true'
|
|
||||||
run: gh workflow run release.yml
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|||||||
@@ -10,82 +10,12 @@ on:
|
|||||||
- "go.sum"
|
- "go.sum"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.24"
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: go test -race -v ./...
|
|
||||||
|
|
||||||
version:
|
|
||||||
needs: test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
version: ${{ steps.version_formatted.outputs.version }}
|
|
||||||
version_tag: ${{ steps.version_formatted.outputs.version_tag }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Calculate version
|
|
||||||
id: semver
|
|
||||||
uses: lukaszraczylo/semver-generator@v1
|
|
||||||
with:
|
|
||||||
config_file: semver.yaml
|
|
||||||
repository_local: true
|
|
||||||
|
|
||||||
- name: Format version
|
|
||||||
id: version_formatted
|
|
||||||
run: |
|
|
||||||
VERSION="${{ steps.semver.outputs.semantic_version }}"
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
echo "version_tag=v${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Print version
|
|
||||||
run: |
|
|
||||||
echo "Version: ${{ steps.version_formatted.outputs.version }}"
|
|
||||||
echo "Version tag: ${{ steps.version_formatted.outputs.version_tag }}"
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: version
|
|
||||||
if: needs.version.outputs.version_tag != ''
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Go
|
jobs:
|
||||||
uses: actions/setup-go@v5
|
release:
|
||||||
|
uses: lukaszraczylo/shared-actions/.github/workflows/go-release.yaml@main
|
||||||
with:
|
with:
|
||||||
go-version: "1.24"
|
go-version: "1.24"
|
||||||
|
secrets: inherit
|
||||||
- name: Create and push tag
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git tag -a ${{ needs.version.outputs.version_tag }} -m "Release ${{ needs.version.outputs.version }}"
|
|
||||||
git push origin ${{ needs.version.outputs.version_tag }}
|
|
||||||
|
|
||||||
- name: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v6
|
|
||||||
with:
|
|
||||||
distribution: goreleaser
|
|
||||||
version: "~> v2"
|
|
||||||
args: release --clean
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
|
||||||
|
|||||||
+13
-6
@@ -22,7 +22,7 @@ builds:
|
|||||||
|
|
||||||
archives:
|
archives:
|
||||||
- id: lolcathost
|
- id: lolcathost
|
||||||
format: tar.gz
|
formats: [tar.gz]
|
||||||
name_template: "lolcathost-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
|
name_template: "lolcathost-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
|
||||||
files:
|
files:
|
||||||
- LICENSE
|
- LICENSE
|
||||||
@@ -49,14 +49,21 @@ release:
|
|||||||
draft: false
|
draft: false
|
||||||
prerelease: auto
|
prerelease: auto
|
||||||
|
|
||||||
brews:
|
homebrew_casks:
|
||||||
- repository:
|
- repository:
|
||||||
owner: lukaszraczylo
|
owner: lukaszraczylo
|
||||||
name: homebrew-taps
|
name: homebrew-taps
|
||||||
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
|
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
|
||||||
directory: Formula
|
directory: Casks
|
||||||
homepage: https://github.com/lukaszraczylo/lolcathost
|
homepage: https://github.com/lukaszraczylo/lolcathost
|
||||||
description: "Dynamic host management tool for macOS and Linux with TUI"
|
description: "Dynamic host management tool with TUI"
|
||||||
license: MIT
|
license: MIT
|
||||||
test: |
|
url:
|
||||||
system "#{bin}/lolcathost", "--version"
|
verified: github.com/lukaszraczylo/lolcathost
|
||||||
|
hooks:
|
||||||
|
post:
|
||||||
|
install: |
|
||||||
|
if OS.mac?
|
||||||
|
system_command "/usr/bin/xattr",
|
||||||
|
args: ["-dr", "com.apple.quarantine", "#{staged_path}/lolcathost"]
|
||||||
|
end
|
||||||
|
|||||||
@@ -50,12 +50,17 @@ lolcathost manages your `/etc/hosts` file with an interactive terminal interface
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Homebrew (macOS/Linux)
|
### Homebrew (macOS)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install lukaszraczylo/taps/lolcathost
|
brew install --cask lukaszraczylo/taps/lolcathost
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Note**: If you previously installed via `brew install lukaszraczylo/taps/lolcathost` (formula), uninstall first:
|
||||||
|
> ```bash
|
||||||
|
> brew uninstall lolcathost
|
||||||
|
> ```
|
||||||
|
|
||||||
After Homebrew installation, run:
|
After Homebrew installation, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
+2
-2
@@ -276,9 +276,9 @@
|
|||||||
<div class="glass p-6 rounded-xl">
|
<div class="glass p-6 rounded-xl">
|
||||||
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-3 flex items-center">
|
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-3 flex items-center">
|
||||||
<i class="fas fa-beer mr-2 text-amber-500"></i>
|
<i class="fas fa-beer mr-2 text-amber-500"></i>
|
||||||
Homebrew (macOS/Linux)
|
Homebrew (macOS)
|
||||||
</h3>
|
</h3>
|
||||||
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto"><code>brew install lukaszraczylo/taps/lolcathost
|
<pre class="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto"><code>brew install --cask lukaszraczylo/taps/lolcathost
|
||||||
sudo lolcathost --install</code></pre>
|
sudo lolcathost --install</code></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="glass p-6 rounded-xl">
|
<div class="glass p-6 rounded-xl">
|
||||||
|
|||||||
Reference in New Issue
Block a user