diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3db7e61 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: release +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Unshallow + run: git fetch --prune --unshallow + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.13 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v1 + 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..7bd58b3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,29 @@ +project_name: pythonbrew +env: + - GO111MODULE=on +before: + hooks: + - go mod tidy +builds: +- + main: ./cmd/pythonbrew/pythonbrew.go + binary: pythonbrew + flags: -trimpath + ldflags: + - -s -w + - -X github.com/utahta/pythonbrew/subcmd.Version={{.Version}} + env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - freebsd + - windows +archives: +- + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip +release: + prerelease: auto