www/content/getting-started/quick-start.md
In this example we will build, archive and release a sample project.
Create a GitHub repository, clone and cd into it, and let's get started!
{{< tabs >}} {{< tab name="Go" icon="go" >}}
Initialize your module with:
go mod init github.com/you/your-repo
Then create a main.go file:
package main
func main() {
println("Ba dum, tss!")
}
{{< /tab >}} {{< tab name="Rust" icon="rust" >}}
Initialize your project with:
cargo init --bin
{{< /tab >}} {{< tab name="Node.js" icon="node" >}}
Initialize your project with:
npm init -y
npm pkg set engines.node=">=25.5 <26"
npm install
Then create an index.js file:
console.log("Ba dum, tss!");
{{< /tab >}} {{< tab name="Zig" icon="zig" >}}
Initialize your project with:
zig init
{{< /tab >}} {{< tab name="Bun" icon="bun" >}}
Initialize your project with:
bun init
{{< /tab >}} {{< tab name="Deno" icon="deno" >}}
Initialize your project with:
deno init
{{< /tab >}} {{< tab name="UV" icon="uv" >}}
Initialize your project with:
uv init
{{< /tab >}} {{< tab name="Poetry" icon="poetry" >}}
Initialize your project with:
poetry new .
{{< /tab >}} {{< /tabs >}}
Run the init command to create an example .goreleaser.yaml file:
goreleaser init
Now, let's run a "local-only" release to see if it works, using the release command:
goreleaser release --snapshot --clean
At this point, you can customize the generated
.goreleaser.yaml or leave it as-is — it's up to you.
Either way, check .goreleaser.yaml into source control.
You can verify your .goreleaser.yaml is valid by running the check command:
goreleaser check
You can also use GoReleaser to build the binary for a single target only, which is useful for local development:
{{< tabs >}} {{< tab name="Go" icon="go" >}}
GOOS="linux" \
GOARCH="arm64" \
goreleaser build --single-target
It will default to your current GOOS/GOARCH.
{{< /tab >}}
{{< tab name="Rust" icon="rust" >}}
TARGET="aarch64-unknown-linux-gnu" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="Node.js" icon="node" >}}
TARGET="linux-arm64" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="Zig" icon="zig" >}}
TARGET="aarch64-linux" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="Bun" icon="bun" >}}
TARGET="bun-linux-arm64" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="Deno" icon="deno" >}}
TARGET="aarch64-unknown-linux-gnu" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="UV" icon="uv" >}}
TARGET="py3-none-any" \
goreleaser build --single-target
{{< /tab >}} {{< tab name="Poetry" icon="poetry" >}}
TARGET="py3-none-any" \
goreleaser build --single-target
{{< /tab >}} {{< /tabs >}}
To release to GitHub, export a GITHUB_TOKEN environment variable containing a
GitHub token that can create releases in your repository.
A classic personal access token needs the repo scope; a fine-grained token
needs contents: write permission on the repository.
You can create a new classic token
with the right scope pre-selected.
[!NOTE] Add the
write:packagesscope as well if you also push Docker images to the GitHub Container Registry. See the GitHub Actions documentation for the full list of permissions each feature needs.
export GITHUB_TOKEN="YOUR_GH_TOKEN"
GoReleaser will use the latest Git tag of your repository.
Now, create a tag and push it to GitHub:
git tag -a v0.1.0 -m "First release"
git push origin v0.1.0
[!NOTE] Check if your tag adheres to semantic versioning.
[!NOTE] If you don't want to create a tag yet, you can also run GoReleaser without publishing based on the latest commit by using the
--snapshotflag:shgoreleaser release --snapshot
Now you can run GoReleaser at the root of your repository:
goreleaser release
That's all it takes!
GoReleaser will build the binaries for your app for the default targets of the
builder being used.
You can customize that by changing the builds section.
Check the builds documentation for more information.
After building the binaries, GoReleaser will create a separate archive for each
target.
You can customize several things by changing the archives section, including
releasing only the binaries and not creating archives at all.
Check the archives documentation for more
information.
Finally, it will create a release on GitHub with all the artifacts.
Check your GitHub project's releases page!
We maintain many example repositories. You can use them to learn more and see how GoReleaser works.
{{< g_button href="https://github.com/orgs/goreleaser/repositories?q=example" label="Browse example repositories" icon="github" primary="true" >}}
If you want to test everything before doing a release "for real", you can use the following techniques.
You can check if you have every tool needed for the current configuration:
goreleaser healthcheck
The build command builds the project without packaging or publishing it:
goreleaser build
This can be useful as part of CI pipelines to verify the project builds without errors for all build targets.
Use the --skip=publish flag to skip publishing:
goreleaser release --skip=publish
Every command documents its own flags. Run the help for any of them:
goreleaser --help
goreleaser release --help