diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35183bd..d2459b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,17 @@ name: release -on: push +on: + push: + tags: + - '*' jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go 1.15 uses: actions/setup-go@v2 with: @@ -21,5 +27,10 @@ jobs: working-directory: front run: yarn install && yarn build - - name: Release placeholder - run: ls front/dist + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_RELEASE_TOKEN }} diff --git a/.gitignore b/.gitignore index a222723..4f87ded 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /.idea -/goxy \ No newline at end of file +/goxy +/dist \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..97bc199 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,39 @@ +before: + hooks: + - go mod tidy + - go mod download +builds: + - main: ./cmd/goxy + binary: goxy + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + +archives: + - format: zip + replacements: + darwin: Darwin + linux: Linux + windows: Windows + amd64: x86_64 + files: + - README.md + - config.yml + - front/dist + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ .Tag }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'