<p>I have cloned your repo and try that in my local machine. Here is the steps :</p>

<ol>
<li><p>Git clone </p></li>
<li><p>executing Dry run (testing everything before doing a release "for real" :</p>

<p>$ goreleaser release --skip-publish</p></li>
<li><p>show there is no error</p>

<pre><code> SIGNING ARTIFACTS
  • pipe skipped              error=artifact signing is disabled
• DOCKER IMAGES
  • pipe skipped              error=docker section is not configured
• PUBLISHING
  • pipe skipped              error=publishing is disabled
• release succeeded after 20.75s

</code></pre></li>
<li><p>execute goreleaser for release</p>

<p>$ goreleaser release</p></li>
<li><p>goreleaser will created <strong>dist</strong> folder inside project and this folder will consist of distribution packages (deb, rpm).</p></li>
</ol>

<p>I have encounter some issues and here is what I do :</p>

<ul>
<li>error=missing GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN</li>
</ul>

<p>create github or gitlab token ( <a href="https://github.com/settings/tokens" rel="nofollow noreferrer">https://github.com/settings/tokens</a>) and put it as environment variabel</p>

<pre><code>export GITHUB_TOKEN=xxxxyyyyyzzzzz
</code></pre>

<p>resolve the issue.</p>

<ul>
<li>pre hook failed: xxxx is not within a known GOPATH/src</li>
</ul>

<p>as I see in your goreleaser.yaml </p>

<pre><code>hooks:
pre: dep ensure
</code></pre>

<p>you're using dep ensure, checking $GOPATH and make sure $GOPATH pointing to right path of your Go project. </p>

<ul>
<li>error=dist is not empty, remove it before running goreleaser or use the --rm-dist flag</li>
</ul>

<p>dist folder has been created before, you can either manually delete the folder or add flags --rm-dist when executing goreleaser command</p>

<pre><code>$ goreleaser release --skip-publish --rm-dist
</code></pre>

<ul>
<li>error=nfpm failed: rpmbuild not present in $PATH</li>
</ul>

<p>this error occured as I was running on mac machine so there is no rpmbuild installed, installing rpm, rpmbuild solve the issue</p>

<pre><code>$brew install rpm
</code></pre>

<ul>
<li>error=git is currently in a dirty state, please check in your pipeline what can be changing the following files:
M Gopkg.lock</li>
</ul>

<p>Goreleaser seems to check file diff, so as because running hook (dep ensure) updating the Gopkg.lock and this changes/updates are not pushed to git. The solution is always pushing the changes to git.</p>

<ul>
<li>error=git tag v1.0.5 was not made against commit 3ae83eebd904d33cc549117254e857ebea04df90</li>
</ul>

<p>reading from GoReleaser documentation which is "GoReleaser enforces semantic versioning and will error on non-compliant tags. Your tag should be a valid semantic version. If it is not, GoReleaser will error."</p>

<p>after pushing to git, make sure you have to update the tags, in this case I updates the tags to v1.0.6 (previously v1.0.5).</p>

<ul>
<li>error=GitHub/GitLab/Gitea Releases: failed to publish artifacts POST <a href="http://xxxyyyzzz/releases" rel="nofollow noreferrer">http://xxxyyyzzz/releases</a>: 404 Not Found []</li>
</ul>

<p>make sure release text is there.</p>

CC BY-SA 4.0
2019-09-06T14:02:16.150Z
thank you, @Dimas Pawitra, and welcome to DevOps SE! Now I've tried the test run and I think there is a dep problem; how to check that? What is failing: ```hook =dep ensure```
Ta Mu
CC BY-SA 4.0
2019-09-06T10:59:15.283Z
2019-09-06T10:59:15.283Z
Dimas Prawira
<p>I am an absolute novice in Golang but I want to modify a Go build script to build a file locally only instead of publishing it to GitHub.</p>

<p><a href="https://github.com/dahendel/docker-machine-driver-cloudstack/blob/master/.goreleaser.yml" rel="nofollow noreferrer">https://github.com/dahendel/docker-machine-driver-cloudstack/blob/master/.goreleaser.yml</a></p>

<p>How to proceed?</p>

<p>I've created a fork with a <a href="https://github.com/1605200517/docker-machine-driver-cloudstack/blob/master/Dockerfile" rel="nofollow noreferrer">Dockerfile</a> to capture the release environment I can so far "reverse-engineer" but as I run it I get the following error and don't know how what and how to modify in the .goreleaser.yml.</p>

<pre><code>   • releasing using goreleaser 0.117.1...
   • loading config file       file=.goreleaser.yml
   • RUNNING BEFORE HOOKS     
   • LOADING ENVIRONMENT VARIABLES
      • pipe skipped              error=publishing is disabled
   • GETTING AND VALIDATING GIT STATE
      • releasing v1.0.5, commit d47a87ff8c671ec70b99a125fd6aadc45949905d
      • pipe skipped              error=disabled during snapshot mode
   • PARSING TAG              
   • SETTING DEFAULTS         
      • LOADING ENVIRONMENT VARIABLES
      • SNAPSHOTING              
      • GITHUB/GITLAB/GITEA RELEASES
      • PROJECT NAME             
      • BUILDING BINARIES        
      • ARCHIVES                 
            • DEPRECATED: `archive` should not be used anymore, check https://goreleaser.com/deprecations#archive for more info.
      • LINUX PACKAGES WITH NFPM 
            • DEPRECATED: `nfpm` should not be used anymore, check https://goreleaser.com/deprecations#nfpm for more info.
      • SNAPCRAFT PACKAGES       
      • CALCULATING CHECKSUMS    
      • SIGNING ARTIFACTS        
      • DOCKER IMAGES            
      • ARTIFACTORY              
      • S3                       
      • BLOB                     
      • HOMEBREW TAP FORMULA     
         • optimistically guessing `brew[0].installs`, double check
      • SCOOP MANIFEST           
   • SNAPSHOTING              
   • CHECKING ./DIST          
   • WRITING EFFECTIVE CONFIG FILE
      • writing                   config=dist/config.yaml
   • GENERATING CHANGELOG     
      • pipe skipped              error=not available for snapshots
   • BUILDING BINARIES        
      • running hook              hook=dep ensure
   ⨯ release failed after 0.01s error=pre hook failed: 
</code></pre>

<build-pipeline>
How to make a goreleaser script to build a deb file locally?
Ta Mu
# How to make a goreleaser script to build a deb file locally?

(Asked by: username_0 on 2019-09-05)

I am an absolute novice in Golang but I want to modify a Go build script to build a file locally only instead of publishing it to GitHub.
https://github.com/dahendel/docker-machine-driver-cloudstack/blob/master/.goreleaser.yml
How to proceed?
I've created a fork with a Dockerfile to capture the release environment I can so far "reverse-engineer" but as I run it I get the following error and don't know how what and how to modify in the .goreleaser.yml.
   • releasing using goreleaser 0.117.1...
   • loading config file       file=.goreleaser.yml
   • RUNNING BEFORE HOOKS     
   • LOADING ENVIRONMENT VARIABLES
      • pipe skipped              error=publishing is disabled
   • GETTING AND VALIDATING GIT STATE
      • releasing v1.0.5, commit d47a87ff8c671ec70b99a125fd6aadc45949905d
      • pipe skipped              error=disabled during snapshot mode
   • PARSING TAG              
   • SETTING DEFAULTS         
      • LOADING ENVIRONMENT VARIABLES
      • SNAPSHOTING              
      • GITHUB/GITLAB/GITEA RELEASES
      • PROJECT NAME             
      • BUILDING BINARIES        
      • ARCHIVES                 
            • DEPRECATED: `archive` should not be used anymore, check https://goreleaser.com/deprecations#archive for more info.
      • LINUX PACKAGES WITH NFPM 
            • DEPRECATED: `nfpm` should not be used anymore, check https://goreleaser.com/deprecations#nfpm for more info.
      • SNAPCRAFT PACKAGES       
      • CALCULATING CHECKSUMS    
      • SIGNING ARTIFACTS        
      • DOCKER IMAGES            
      • ARTIFACTORY              
      • S3                       
      • BLOB                     
      • HOMEBREW TAP FORMULA     
         • optimistically guessing `brew[0].installs`, double check
      • SCOOP MANIFEST           
   • SNAPSHOTING              
   • CHECKING ./DIST          
   • WRITING EFFECTIVE CONFIG FILE
      • writing                   config=dist/config.yaml
   • GENERATING CHANGELOG     
      • pipe skipped              error=not available for snapshots
   • BUILDING BINARIES        
      • running hook              hook=dep ensure
   ⨯ release failed after 0.01s error=pre hook failed:

**Tags:** build-pipeline


---

## 1 answers

### Answer by username_1 on 2019-09-06. Score: 1 | Accepted answer

I have cloned your repo and try that in my local machine. Here is the steps :

Git clone 
executing Dry run (testing everything before doing a release "for real" :
$ goreleaser release --skip-publish
show there is no error
 SIGNING ARTIFACTS
  • pipe skipped              error=artifact signing is disabled
• DOCKER IMAGES
  • pipe skipped              error=docker section is not configured
• PUBLISHING
  • pipe skipped              error=publishing is disabled
• release succeeded after 20.75s


execute goreleaser for release
$ goreleaser release
goreleaser will created dist folder inside project and this folder will consist of distribution packages (deb, rpm).

I have encounter some issues and here is what I do :

error=missing GITHUB_TOKEN, GITLAB_TOKEN and GITEA_TOKEN

create github or gitlab token ( https://github.com/settings/tokens) and put it as environment variabel
export GITHUB_TOKEN=xxxxyyyyyzzzzz

resolve the issue.

pre hook failed: xxxx is not within a known GOPATH/src

as I see in your goreleaser.yaml 
hooks:
pre: dep ensure

you're using dep ensure, checking $GOPATH and make sure $GOPATH pointing to right path of your Go project. 

error=dist is not empty, remove it before running goreleaser or use the --rm-dist flag

dist folder has been created before, you can either manually delete the folder or add flags --rm-dist when executing goreleaser command
$ goreleaser release --skip-publish --rm-dist


error=nfpm failed: rpmbuild not present in $PATH

this error occured as I was running on mac machine so there is no rpmbuild installed, installing rpm, rpmbuild solve the issue
$brew install rpm


error=git is currently in a dirty state, please check in your pipeline what can be changing the following files:
M Gopkg.lock

Goreleaser seems to check file diff, so as because running hook (dep ensure) updating the Gopkg.lock and this changes/updates are not pushed to git. The solution is always pushing the changes to git.

error=git tag v1.0.5 was not made against commit 3ae83eebd904d33cc549117254e857ebea04df90

reading from GoReleaser documentation which is "GoReleaser enforces semantic versioning and will error on non-compliant tags. Your tag should be a valid semantic version. If it is not, GoReleaser will error."
after pushing to git, make sure you have to update the tags, in this case I updates the tags to v1.0.6 (previously v1.0.5).

error=GitHub/GitLab/Gitea Releases: failed to publish artifacts POST http://xxxyyyzzz/releases: 404 Not Found []

make sure release text is there.

> **Comments:**
> **username_0**: thank you, @Dimas Pawitra, and welcome to DevOps SE! Now I've tried the test run and I think there is a dep problem; how to check that? What is failing: ```hook =dep ensure```  

---

