Skip to content

Commit 0b865cd

Browse files
committed
ci: pass path to make docs
1 parent ee04d7c commit 0b865cd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
v: true
3535
x: true
3636
- run: make docs
37+
env:
38+
MAN_PATH: ${{ env.GITHUB_WORKSPACE }}/.build
3739
- uses: softprops/action-gh-release@v1
3840
with:
3941
tag_name: v${{ steps.version.outputs.version }}

docs.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ func main() {
1818
log.Fatal(err)
1919
}
2020

21+
manpath := os.Getenv("MAN_PATH")
22+
if manpath == "" {
23+
manpath = "./.build"
24+
}
25+
2126
hdr := &doc.GenManHeader{Title: info.NAME, Section: "1"}
22-
if err := doc.GenManTree(cmd.Root, hdr, "./.build"); err != nil {
27+
if err := doc.GenManTree(cmd.Root, hdr, manpath); err != nil {
2328
log.Fatal(err)
2429
}
2530

26-
archive, err := os.Create("./.build/" + info.NAME + ".1.tar")
31+
archive, err := os.Create(filepath.Join(manpath, info.NAME+".1.tar"))
2732
if err != nil {
2833
log.Fatal(err)
2934
}
@@ -32,7 +37,7 @@ func main() {
3237
tw := tar.NewWriter(archive)
3338
defer tw.Close()
3439

35-
pages, err := filepath.Glob("./.build/*.1")
40+
pages, err := filepath.Glob(filepath.Join(manpath, "*.1"))
3641
if err != nil {
3742
log.Fatal(err)
3843
}

0 commit comments

Comments
 (0)