From 47ab81973ea0f98a13f736316fceabb1d6066a66 Mon Sep 17 00:00:00 2001 From: d-tsuji Date: Sun, 13 Dec 2020 15:57:34 +0900 Subject: [PATCH] add: go releaser --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++ .goreleaser.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4daabc7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +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 + with: + fetch-depth: 1 + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.x + + - 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..4b52969 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,38 @@ +project_name: awsmfa +env: + - GO111MODULE=on +before: + hooks: + - go mod tidy +builds: + - main: ./cmd/awsmfa + binary: awsmfa + flags: + - -trimpath + ldflags: + - -s -w + env: + - CGO_ENABLED=0 + goos: + - windows + - darwin + - linux + goarch: + - amd64 + - 386 +archives: + - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip +release: + prerelease: auto + github: + owner: d-tsuji + name: awsmfa