diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7365750 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +# This GitHub action can publish assets for release when a tag is created. +# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). + +name: release +on: + push: + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..63b26d3 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,38 @@ +# Visit https://goreleaser.com for documentation on how to customize this +# behavior. +before: + hooks: + # this is just an example and not a requirement for provider building/publishing + - go mod tidy +builds: + - env: + # goreleaser does not work with CGO, it could also complicate + # usage by users in CI/CD systems like Terraform Cloud where + # they are unable to install libraries. + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - '386' + - arm + - arm64 + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: + - format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +release: + # Visit your project's GitHub Releases page to publish this release . + draft: true +changelog: + skip: true diff --git a/build_lamp b/build_lamp deleted file mode 100755 index 73dfa20..0000000 --- a/build_lamp +++ /dev/null @@ -1,5 +0,0 @@ -cd $GOPATH/src/github.com/opsgenie/opsgenie-lamp - -GOOS=darwin GOARCH=amd64 go build -mod=vendor -o opsgenie-lamp-mac -GOOS=linux GOARCH=386 go build -mod=vendor -GOOS=windows GOARCH=386 go build -mod=vendor diff --git a/build_lamp.bat b/build_lamp.bat deleted file mode 100644 index feb81b2..0000000 --- a/build_lamp.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -cd %GOPATH%\src\github.com\opsgenie\opsgenie-lamp -go get . - -setlocal -set GOOS=windows -set GOARCH=386 -echo building for %GOOS%/%GOARCH% -go build -mod=vendor - -set GOOS=linux -set GOARCH=386 -echo building for %GOOS%/%GOARCH% -go build -mod=vendor - -set GOOS=darwin -set GOARCH=386 -echo building for %GOOS%/%GOARCH% -go build -mod=vendor -o opsgenie-lamp-mac - -endlocal