From bbfdfb7cf569e46a518793b9cc61bc18d9da01e6 Mon Sep 17 00:00:00 2001 From: Yuvraj <10830562+evalsocket@users.noreply.github.com> Date: Fri, 2 Apr 2021 22:35:29 +0530 Subject: [PATCH] Added goreleaser dry run in build (#47) * Added goreleaser dry run in build Signed-off-by: yuvraj * bug fix in goreleaser Signed-off-by: yuvraj --- .github/workflows/build.yaml | 7 +++- .github/workflows/release.yml | 2 +- .goreleaser.yml | 69 +++-------------------------------- 3 files changed, 12 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4b78569361..a7d933fed4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Run GoReleaser dry run + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: --snapshot --skip-publish --rm-dist - name: Unit Tests uses: cedrickring/golang-action@1.5.2 env: @@ -28,4 +33,4 @@ jobs: env: GO111MODULE: "on" with: - args: make install && make lint \ No newline at end of file + args: make install && make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4c2de9fd3..6f27d86990 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,4 +16,4 @@ jobs: version: latest args: release --rm-dist --debug env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 43862c26fb..4f9557b3cd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -13,8 +13,9 @@ builds: ldflags: - -s -w -X github.com/flyteorg/flytestdlib/version.Version={{.Version}} -X github.com/flyteorg/flytestdlib/version.Build={{.ShortCommit}} -X github.com/flyteorg/flytestdlib/version.BuildTime={{.Date}} archives: - - replacements: - darwin: macOS + - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + replacements: + darwin: Darwin linux: Linux windows: Windows 386: i386 @@ -32,46 +33,11 @@ changelog: exclude: - '^docs:' - '^test:' -scoop: - # Default is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - # url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}" - - # Repository to push the app manifest to. - bucket: - owner: flyteorg - name: flytectl - - # Git author used to commit to the repository. - # Defaults are shown. - commit_author: - name: goreleaserbot - email: goreleaser@carlosbecker.com - - # Your app's homepage. - # Default is empty. - homepage: "https://godoc.org/github.com/flyteorg/flytectl" - - # Your app's description. - # Default is empty. - description: "FlyteCtl is a command line tool to interact with a Flyte cluster." - - # Your app's license - # Default is empty. - license: Apache-2.0 - - # Persist data between application updates - persist: - - "config.toml" brews: - # Name template of the recipe # Default to project name name: flytectl - # GOARM to specify which 32-bit arm version to use if there are multiple versions - # from the build section. Brew formulas support atm only one 32-bit version. - # Default is 6 for all artifacts or each id if there a multiple versions. - goarm: 6 - folder: Formula # Github repository to push the tap to. @@ -79,21 +45,6 @@ brews: owner: flyteorg name: homebrew-tap - # Template for the url which is determined by the given Token (github or gitlab) - # Default for github is "https://github.com///releases/download/{{ .Tag }}/{{ .ArtifactName }}" - # Default for gitlab is "https://gitlab.com///uploads/{{ .ArtifactUploadHash }}/{{ .ArtifactName }}" - url_template: "http://github.com/flyteorg/flytectl/releases/{{ .Tag }}/{{ .ArtifactName }}" - - # Allows you to set a custom download strategy. Note that you'll need - # to implement the strategy and add it to your tap repository. - # Example: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly - # Default is empty. - download_strategy: CurlDownloadStrategy. - - # Allows you to add a custom require_relative at the top of the formula template - # Default is empty - custom_require: custom_download_strategy - # Git author used to commit to the repository. # Defaults are shown. commit_author: @@ -108,18 +59,8 @@ brews: # Default is empty. description: "FlyteCtl is a command line tool to interact with a Flyte cluster." - # Setting this will prevent goreleaser to actually try to commit the updated - # formula - instead, the formula file will be stored on the dist folder only, - # leaving the responsibility of publishing it to the user. - # If set to auto, the release will not be uploaded to the homebrew tap - # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 # Default is false. skip_upload: auto - # So you can `brew test` your formula. - # Default is empty. - test: system "#{bin}/program --version" - - # Custom install script for brew. - # Default is 'bin.install "program"'. - install: bin.install "program" + dependencies: + - name: go \ No newline at end of file