Skip to content

Commit 63b38f1

Browse files
chore: Setup goreleaser (#9)
1 parent 4126241 commit 63b38f1

File tree

14 files changed

+152
-24
lines changed

14 files changed

+152
-24
lines changed

.github/workflows/release-please.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: release-please
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
token: ${{ secrets.GH_PAT }}
20+
release-type: go

.github/workflows/release.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: goreleaser
3+
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
pkggodev:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Update pkg.go.dev endpoint
22+
run: curl "https://proxy.golang.org/github.com/germainlefebvre4/cvwonder/@v/${{ github.ref_name }}.info"
23+
24+
goreleaser:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up Go
33+
uses: actions/setup-go@v5
34+
35+
- name: Run GoReleaser
36+
uses: goreleaser/goreleaser-action@v6
37+
with:
38+
distribution: goreleaser
39+
version: latest
40+
args: release --clean
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
43+
44+
- name: Upload assets
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: cvwonder
48+
path: dist/*

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ cv.html
2424

2525
# Documentation
2626
.venv/
27+
28+
dist/

.goreleaser.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
3+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
4+
5+
version: 2
6+
7+
before:
8+
hooks:
9+
- go mod tidy
10+
11+
builds:
12+
- env:
13+
- CGO_ENABLED=0
14+
goos:
15+
- linux
16+
- windows
17+
- darwin
18+
main: ./cmd/{{ .ProjectName }}/main.go
19+
20+
archives:
21+
- format: tar.gz
22+
name_template: >-
23+
{{ .ProjectName }}_
24+
{{- title .Os }}_
25+
{{- if eq .Arch "amd64" }}x86_64
26+
{{- else if eq .Arch "386" }}i386
27+
{{- else }}{{ .Arch }}{{ end }}
28+
{{- if .Arm }}v{{ .Arm }}{{ end }}
29+
format_overrides:
30+
- goos: windows
31+
format: zip
32+
33+
changelog:
34+
sort: asc
35+
filters:
36+
exclude:
37+
- "^docs:"
38+
- "^test:"
39+
40+
release:
41+
prerelease: auto
42+
43+
checksum:
44+
name_template: 'checksums.txt'

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66

77
## Getting started
88

9-
Install the binary using `go get`:
9+
Download the latest release from the [releases page](https://github.com/germainlefebvre4/cvwonder/releases).
1010

1111
```bash
12-
go get github.com/germainlefebvre/cvwonder
12+
DISTRIBUTION=Linux
13+
CPU_ARCH=x86_64
14+
VERSION=$(curl -s "https://api.github.com/repos/germainlefebvre4/cvwonder/releases/latest" | jq -r '.tag_name')
15+
curl -L -o cvwonder.tar.gz "https://github.com/germainlefebvre4/cvwonder/releases/download/${VERSION}/cvwonder_${DISTRIBUTION}_${CPU_ARCH}.tar.gz"
16+
tar -xzf cvwonder.tar.gz
17+
chmod +x cvwonder
18+
sudo mv cvwonder /usr/local/bin/
1319
```
1420

1521
Write your CV in a YAML file (i.e; `cv.yml`):

cmd/cvwonder/cvwonder.go cmd/cvwonder/main.go

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
package main
22

33
import (
4-
"cvwonder/internal/cvparser"
5-
"cvwonder/internal/cvrender"
6-
"cvwonder/internal/cvserve"
7-
"cvwonder/internal/model"
8-
"cvwonder/internal/utils"
9-
"cvwonder/internal/watcher"
104
"fmt"
115
"os"
126

7+
"github.com/germainlefebvre4/cvwonder/internal/cvparser"
8+
"github.com/germainlefebvre4/cvwonder/internal/cvrender"
9+
"github.com/germainlefebvre4/cvwonder/internal/cvserve"
10+
"github.com/germainlefebvre4/cvwonder/internal/model"
11+
"github.com/germainlefebvre4/cvwonder/internal/utils"
12+
"github.com/germainlefebvre4/cvwonder/internal/watcher"
13+
1314
"github.com/sirupsen/logrus"
1415
"github.com/spf13/cobra"
1516
)
@@ -24,8 +25,8 @@ func main() {
2425
var rootCmd = &cobra.Command{
2526
PreRun: utils.ToggleDebug,
2627
Use: "cvwonder [COMMAND] [OPTIONS]",
27-
Short: "CVRender",
28-
Long: `CVRender - Launch CVRender CLI`,
28+
Short: "CV Wonder",
29+
Long: `CV Wonder - Generate your CV with Wonder!`,
2930
}
3031

3132
var generateCmd = &cobra.Command{

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module cvwonder
1+
module github.com/germainlefebvre4/cvwonder
22

33
go 1.23.4
44

internal/cvparser/parser.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package cvparser
22

33
import (
4-
"cvwonder/internal/model"
5-
"cvwonder/internal/utils"
64
"os"
75

6+
"github.com/germainlefebvre4/cvwonder/internal/model"
7+
"github.com/germainlefebvre4/cvwonder/internal/utils"
8+
89
"github.com/sirupsen/logrus"
910
"gopkg.in/yaml.v2"
1011
)

internal/cvrender/html/html.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package render_html
22

33
import (
4-
"cvwonder/internal/model"
5-
utils "cvwonder/internal/utils"
64
"errors"
75
"os"
86
"path/filepath"
97
"strings"
108
"text/template"
119

10+
"github.com/germainlefebvre4/cvwonder/internal/model"
11+
utils "github.com/germainlefebvre4/cvwonder/internal/utils"
12+
1213
"github.com/sirupsen/logrus"
1314
)
1415

internal/cvrender/render.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package cvrender
22

33
import (
4-
render_html "cvwonder/internal/cvrender/html"
5-
"cvwonder/internal/model"
6-
"cvwonder/internal/utils"
74
"path"
85

6+
render_html "github.com/germainlefebvre4/cvwonder/internal/cvrender/html"
7+
"github.com/germainlefebvre4/cvwonder/internal/model"
8+
"github.com/germainlefebvre4/cvwonder/internal/utils"
9+
910
"github.com/sirupsen/logrus"
1011
)
1112

internal/cvserve/browser.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cvserve
22

33
import (
4-
"cvwonder/internal/utils"
54
"fmt"
65
"os/exec"
76
"path"
87
"path/filepath"
98
"runtime"
109

10+
"github.com/germainlefebvre4/cvwonder/internal/utils"
11+
1112
"github.com/sirupsen/logrus"
1213
)
1314

internal/cvserve/serve.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cvserve
22

33
import (
4-
"cvwonder/internal/utils"
54
"fmt"
65
"log"
76
"net/http"
87
"path"
98
"path/filepath"
109

10+
"github.com/germainlefebvre4/cvwonder/internal/utils"
11+
1112
"github.com/fsnotify/fsnotify"
1213
"github.com/jaschaephraim/lrserver"
1314
"github.com/sirupsen/logrus"

internal/model/files.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package model
22

33
import (
4-
"cvwonder/internal/utils"
54
"os"
65
"path/filepath"
76
"strings"
7+
8+
"github.com/germainlefebvre4/cvwonder/internal/utils"
89
)
910

1011
type InputFile struct {

internal/watcher/watcher.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
package watcher
22

33
import (
4-
"cvwonder/internal/cvparser"
5-
"cvwonder/internal/cvrender"
6-
"cvwonder/internal/utils"
74
"fmt"
85
"log"
96

7+
"github.com/germainlefebvre4/cvwonder/internal/cvparser"
8+
"github.com/germainlefebvre4/cvwonder/internal/cvrender"
9+
"github.com/germainlefebvre4/cvwonder/internal/utils"
10+
1011
"github.com/fsnotify/fsnotify"
1112
"github.com/sirupsen/logrus"
1213
)

0 commit comments

Comments
 (0)