diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 928d8e8..c7ba60f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: push: tags: - 'v*' + pull_request: + paths: + - '**/.github/**/*' # workflow tasks jobs: @@ -19,11 +22,16 @@ jobs: tagRegexGroup: 1 # Optional. Default is 1. - name: Checkout the repository uses: actions/checkout@v2 + # - uses: actions/setup-go@v3 + # with: + # go-version: '^1.17.0' # The Go version to download (if necessary) and use. + # - run: | + # go vet . - name: Generate build files uses: thatisuday/go-cross-build@v1.1.0 with: platforms: 'linux/amd64' - package: 'src' + package: '.' name: 'yggdrasil-worker-forwarder-${{ steps.tagName.outputs.tag }}' compress: 'true' dest: 'dist' @@ -34,6 +42,7 @@ jobs: env: VERSION: '${{ steps.tagName.outputs.tag }}' - name: Upload binaries to release + if: "${{ steps.tagName.outputs.tag != '' }}" # tag will be empty on pull requests, no publishing needed uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/main.go b/main.go index e58391c..e4727dd 100644 --- a/main.go +++ b/main.go @@ -2,11 +2,12 @@ package main import ( "context" + "fmt" "net" "os" - "time" - "fmt" + "path/filepath" "strings" + "time" "git.sr.ht/~spc/go-log" "github.com/pelletier/go-toml" @@ -24,8 +25,7 @@ func main() { if ok { config, err := toml.LoadFile(configFile) if err != nil { - fmt.Errorf("cannot load config: %w", err) - return + log.Fatal(fmt.Errorf("cannot load config: %w", err)) } for _, value := range config.GetArray("env").([]string) {