Skip to content

Commit

Permalink
Add version and build release
Browse files Browse the repository at this point in the history
  • Loading branch information
Celedhrim committed Feb 1, 2023
1 parent b004692 commit 74f14ff
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/releasebuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
release:
types: [created]

jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- uses: wangyoucao577/go-release-action@v1.35
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.19"
11 changes: 11 additions & 0 deletions scantopl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
Expand All @@ -15,6 +16,10 @@ import (
log "github.com/sirupsen/logrus"
)

var (
Version = "v1.0.0"
)

func FilenameWithoutExtension(fn string) string {
return strings.TrimSuffix(path.Base(fn), path.Ext(fn))
}
Expand Down Expand Up @@ -79,9 +84,15 @@ func main() {
scandir := flag.String("scandir", "/home/scanservjs/output", "Scanserjs ouput directory")
plurl := flag.String("plurl", "http://localhost:8080", "The paperless instance URL without trailing /")
pltoken := flag.String("pltoken", "xxxxxxxxxxxxxxxxxx", "Paperless auth token , generated through admin")
showversion := flag.Bool("version", false, "Show version and exit")

flag.Parse()

if *showversion {
fmt.Println("version", Version)
os.Exit(0)
}

// test if it's a directory
log.Println("Start watching:", *scandir)

Expand Down

0 comments on commit 74f14ff

Please sign in to comment.