diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c602ae4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: goreleaser + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index e74ffbc..620b7a8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ bin/ config/dev.yaml -go.sum \ No newline at end of file +go.sum +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..34afec2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,25 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +project_name: gocn-push + +env: + - GO111MODULE=on +before: + hooks: + - go mod tidy +builds: + - main: ./cmd + binary: gocn-push + ldflags: '-s -w' + goos: + - linux + - windows + - darwin +archives: + - files: + - README.md + format_overrides: + - goos: windows + format: zip +release: + prerelease: auto \ No newline at end of file diff --git a/go.mod b/go.mod index 2a9b909..2234b62 100644 --- a/go.mod +++ b/go.mod @@ -16,5 +16,4 @@ require ( github.com/spf13/viper v1.7.1 github.com/temoto/robotstxt v1.1.1 // indirect google.golang.org/appengine v1.6.6 // indirect - gopkg.in/resty.v1 v1.12.0 )