diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..dab230e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,28 @@ +name: release +on: + push: + tags: + - 'v*' + +jobs: + test: + name: Build and package + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '1.15.6' + - name: Check formatting + run: test -z $(gofmt -l **.go) + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..3a05f19 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,31 @@ +builds: + - id: cli + binary: gdqcli + main: ./cmd/gdqcli + mod_timestamp: '{{ .CommitTimestamp }}' + gcflags: + - all=-trimpath={{.Env.GOPATH}} + env: + - CGO_ENABLED=0 + goos: + - windows + - darwin + - linux + goarch: + - amd64 + - arm64 + - arm + goarm: + - 6 + - 7 +archives: + - id: cli + builds: + - cli + wrap_in_directory: true + files: + - LICENSE + - README.md + format_overrides: + - goos: windows + format: zip