dispatchrun / dispatch

Entrypoint of the Dispatch ecosystem.
11 stars 1 forks source link

Show correct version #77

Closed chicoxyzzy closed 2 months ago

chicoxyzzy commented 2 months ago

Fixes #64

@chriso is this enough? How can I test this locally? I've tried to run goreleaser release --snapshot --clean, the output is:

➜ goreleaser release --snapshot --clean
  • starting release...
  • only configurations files on  version: 2  are supported, yours is  version: 0 , please update your configuration
  • loading                                          path=.goreleaser.yml
  • skipping announce, publish and validate...
  • loading environment variables
  • getting and validating git state
    • git state                                      commit=5ba89d384d8067becde40b73714eff7db801e4ad branch=main current_tag=v0.2.0 previous_tag=v0.1.0 dirty=true
    • pipe skipped                                   reason=disabled during snapshot mode
  • parsing tag
  • setting defaults
  • snapshotting
    • building snapshot...                           version=0.2.0-SNAPSHOT-5ba89d3
  • running before hooks
    • running                                        hook=go mod tidy
  • checking distribution directory
  • setting up metadata
  • storing release metadata
    • writing                                        file=goreleaser/dist/metadata.json
  • loading go mod information
  • build prerequisites
  • checking go.mod
  • writing effective config file
    • writing                                        config=goreleaser/dist/config.yaml
  • building binaries
    • building                                       binary=goreleaser/dist/dispatch_linux_arm64/dispatch
    • building                                       binary=goreleaser/dist/dispatch_linux_amd64_v1/dispatch
    • building                                       binary=goreleaser/dist/dispatch_darwin_amd64_v1/dispatch
    • building                                       binary=goreleaser/dist/dispatch_darwin_arm64/dispatch
    • took: 30s
  • archives
    • creating                                       archive=goreleaser/dist/dispatch_0.2.0-SNAPSHOT-5ba89d3_darwin_arm64.tar.gz
    • creating                                       archive=goreleaser/dist/dispatch_0.2.0-SNAPSHOT-5ba89d3_darwin_amd64.tar.gz
    • creating                                       archive=goreleaser/dist/dispatch_0.2.0-SNAPSHOT-5ba89d3_linux_amd64.tar.gz
    • creating                                       archive=goreleaser/dist/dispatch_0.2.0-SNAPSHOT-5ba89d3_linux_arm64.tar.gz
    • took: 2s
  • calculating checksums
  • homebrew tap formula
    • guessing install                               install=[bin.install "dispatch"]
    • guessing install                               install=[bin.install "dispatch"]
    • guessing install                               install=[bin.install "dispatch"]
    • guessing install                               install=[bin.install "dispatch"]
    • writing                                        formula=goreleaser/dist/homebrew/Formula/dispatch.rb
  • storing artifacts metadata
    • writing                                        file=goreleaser/dist/artifacts.json
  • release succeeded after 32s
  • thanks for using goreleaser!
chicoxyzzy commented 2 months ago

When I create a tag locally and then run goreleaser, it still shows me dispatch version devel <sha>

chicoxyzzy commented 2 months ago

we should find a way to test it locally to test such cases

chriso commented 2 months ago

When I create a tag locally and then run goreleaser, it still shows me dispatch version devel

I imagine the fact that the tag hasn't been pushed to GitHub is the issue. goreleaser would be creating a dummy Go module and then pulling Dispatch as a dependency of that module before building it. If you haven't pushed the tag, go get won't see it when the github.com/dispatchrun/dispatch dependency is downloaded and the module built.

Given this a minor change, I think it's probably fine to merge and then wait until we tag a release to verify that it's working correctly. If we get it wrong, we can always fix it and then tag a new release.