Skip to content

Commit b262681

Browse files
committed
add release
1 parent 1c1bd36 commit b262681

File tree

5 files changed

+162
-0
lines changed

5 files changed

+162
-0
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: "1.23"
22+
23+
- uses: goreleaser/goreleaser-action@v6
24+
with:
25+
version: "~> v2"
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
7+
builds:
8+
- main: ./cmd/dotular
9+
binary: dotular
10+
env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- darwin
14+
- linux
15+
- windows
16+
goarch:
17+
- amd64
18+
- arm64
19+
ldflags:
20+
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
21+
22+
archives:
23+
- format: tar.gz
24+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
25+
format_overrides:
26+
- goos: windows
27+
format: zip
28+
29+
checksum:
30+
name_template: "checksums.txt"
31+
32+
changelog:
33+
sort: asc
34+
filters:
35+
exclude:
36+
- "^docs:"
37+
- "^test:"
38+
39+
brews:
40+
- repository:
41+
owner: atomikpanda
42+
name: dotular
43+
directory: Formula
44+
homepage: "https://github.com/atomikpanda/dotular"
45+
description: "A config-driven dotfile manager"
46+
license: "MIT"
47+
test: |
48+
system "#{bin}/dotular", "platform"
49+
install: |
50+
bin.install "dotular"

Formula/dotular.rb

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# typed: false
2+
# frozen_string_literal: true
3+
4+
# This formula is automatically updated by GoReleaser on each release.
5+
# To install: brew tap atomikpanda/dotular https://github.com/atomikpanda/dotular && brew install dotular
6+
class Dotular < Formula
7+
desc "A config-driven dotfile manager"
8+
homepage "https://github.com/atomikpanda/dotular"
9+
license "MIT"
10+
11+
on_macos do
12+
on_arm do
13+
url "https://github.com/atomikpanda/dotular/releases/download/v0.1.0/dotular_0.1.0_darwin_arm64.tar.gz"
14+
sha256 "PLACEHOLDER"
15+
end
16+
on_intel do
17+
url "https://github.com/atomikpanda/dotular/releases/download/v0.1.0/dotular_0.1.0_darwin_amd64.tar.gz"
18+
sha256 "PLACEHOLDER"
19+
end
20+
end
21+
22+
on_linux do
23+
on_arm do
24+
url "https://github.com/atomikpanda/dotular/releases/download/v0.1.0/dotular_0.1.0_linux_arm64.tar.gz"
25+
sha256 "PLACEHOLDER"
26+
end
27+
on_intel do
28+
url "https://github.com/atomikpanda/dotular/releases/download/v0.1.0/dotular_0.1.0_linux_amd64.tar.gz"
29+
sha256 "PLACEHOLDER"
30+
end
31+
end
32+
33+
def install
34+
bin.install "dotular"
35+
end
36+
37+
test do
38+
system "#{bin}/dotular", "platform"
39+
end
40+
end

cmd/dotular/main.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ import (
2727
"github.com/atomikpanda/dotular/internal/ui"
2828
)
2929

30+
var (
31+
version = "dev"
32+
commit = "none"
33+
date = "unknown"
34+
)
35+
3036
var (
3137
configFile string
3238
dryRun bool
@@ -59,6 +65,7 @@ and Linux using a single YAML file.`,
5965
root.PersistentFlags().BoolVar(&noCache, "no-cache", false, "re-fetch registry modules from the network")
6066

6167
root.AddCommand(
68+
versionCmd(),
6269
initCmd(),
6370
addCmd(),
6471
applyCmd(),
@@ -79,6 +86,18 @@ and Linux using a single YAML file.`,
7986
return root
8087
}
8188

89+
// --- version -----------------------------------------------------------------
90+
91+
func versionCmd() *cobra.Command {
92+
return &cobra.Command{
93+
Use: "version",
94+
Short: "Print the version of dotular",
95+
Run: func(cmd *cobra.Command, args []string) {
96+
fmt.Printf("dotular %s (commit: %s, built: %s)\n", version, commit, date)
97+
},
98+
}
99+
}
100+
82101
// loadConfig parses the raw config file without registry resolution.
83102
func loadConfig() (config.Config, error) {
84103
cfg, err := config.Load(configFile)

modules/google-chrome.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,28 @@ items:
1919

2020
- package: googlechrome
2121
via: choco
22+
23+
- file: Preferences
24+
destination:
25+
macos: ~/Library/Application Support/Google/Chrome/Default
26+
linux: ~/.config/google-chrome/Default
27+
windows: "%LOCALAPPDATA%\\Google\\Chrome\\User Data\\Default"
28+
29+
- file: Bookmarks
30+
permissions: "0600"
31+
destination:
32+
macos: ~/Library/Application Support/Google/Chrome/Default
33+
linux: ~/.config/google-chrome/Default
34+
windows: "%LOCALAPPDATA%\\Google\\Chrome\\User Data\\Default"
35+
36+
- file: Local State
37+
destination:
38+
macos: ~/Library/Application Support/Google/Chrome
39+
linux: ~/.config/google-chrome
40+
windows: "%LOCALAPPDATA%\\Google\\Chrome\\User Data"
41+
42+
- directory: Extensions
43+
destination:
44+
macos: ~/Library/Application Support/Google/Chrome/Default/Extensions
45+
linux: ~/.config/google-chrome/Default/Extensions
46+
windows: "%LOCALAPPDATA%\\Google\\Chrome\\User Data\\Default\\Extensions"

0 commit comments

Comments
 (0)