1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00

docs: improve docs

This commit is contained in:
Carlos Alexandro Becker 2019-03-24 20:10:30 -03:00
parent 7c41d888f5
commit 367c6c0d1d
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
16 changed files with 92 additions and 128 deletions

View File

@ -36,7 +36,7 @@ deploy:
verbose: true verbose: true
fqdn: goreleaser.com fqdn: goreleaser.com
on: on:
tags: true master: true
- provider: script - provider: script
skip_cleanup: true skip_cleanup: true
script: ./goreleaser script: ./goreleaser

View File

@ -24,13 +24,13 @@ $ git clone git@github.com:goreleaser/goreleaser.git
Install the build and lint dependencies: Install the build and lint dependencies:
```console ```sh
$ make setup $ make setup
``` ```
A good way of making sure everything is all right is running the test suite: A good way of making sure everything is all right is running the test suite:
```console ```sh
$ make test $ make test
``` ```
@ -38,13 +38,13 @@ $ make test
You can create a branch for your changes and try to build from the source as you go: You can create a branch for your changes and try to build from the source as you go:
```console ```sh
$ make build $ make build
``` ```
When you are satisfied with the changes, we suggest you run: When you are satisfied with the changes, we suggest you run:
```console ```sh
$ make ci $ make ci
``` ```

View File

@ -8,4 +8,5 @@ pygmentsCodeFences = true
pygmentsStyle = "dracula" pygmentsStyle = "dracula"
[params] [params]
logo = "https://avatars2.githubusercontent.com/u/24697112?v=3&s=140" logo = "https://github.com/goreleaser.png"
ghdocsrepo = "https://github.com/goreleaser/goreleaser/edit/master/www"

View File

@ -52,8 +52,8 @@ Supported variables:
- Arch - Arch
- Arm - Arm
_Attention_: Variables _Os_, _Arch_ and _Arm_ are only supported in upload > **Attention**: Variables _Os_, _Arch_ and _Arm_ are only supported in upload
mode `binary`. > mode `binary`.
### Username ### Username

View File

@ -108,7 +108,7 @@ builds:
Then you can run: Then you can run:
```console ```sh
GOVERSION=$(go version) goreleaser GOVERSION=$(go version) goreleaser
``` ```

View File

@ -159,26 +159,26 @@ changelog containing just the messages from the commits since the prior tag.
```yml ```yml
steps: steps:
~ # Setup the workspace so we have a viable place to point GOPATH at. # Setup the workspace so we have a viable place to point GOPATH at.
~ - name: gcr.io/cloud-builders/go - name: gcr.io/cloud-builders/go
~ env: ['PROJECT_ROOT=github.com/YourGithubUser/YourGithubRepo'] env: ['PROJECT_ROOT=github.com/YourGithubUser/YourGithubRepo']
~_ args: ['env'] args: ['env']
~ # Create github release. # Create github release.
~ - name: goreleaser/goreleaser - name: goreleaser/goreleaser
~ entrypoint: /bin/sh entrypoint: /bin/sh
~ dir: gopath/src/github.com dir: gopath/src/github.com
~ env: ['GOPATH=/workspace/gopath'] env: ['GOPATH=/workspace/gopath']
~ args: ['-c', 'cd YourGithubUser/YourGithubRepo && git tag $TAG_NAME && /goreleaser' ] args: ['-c', 'cd YourGithubUser/YourGithubRepo && git tag $TAG_NAME && /goreleaser' ]
~_ secretEnv: ['GITHUB_TOKEN'] secretEnv: ['GITHUB_TOKEN']
secrets: secrets:
~ - kmsKeyName: projects/YourProjectId/locations/global/keyRings/YourKeyRing/cryptoKeys/YourKey - kmsKeyName: projects/YourProjectId/locations/global/keyRings/YourKeyRing/cryptoKeys/YourKey
~ secretEnv: secretEnv:
~ GITHUB_TOKEN: | GITHUB_TOKEN: |
~ ICAgICAgICBDaVFBZUhVdUVoRUtBdmZJSGxVWnJDZ0hOU2NtMG1ES0k4WjF3L04zT3pEazhRbDZr ICAgICAgICBDaVFBZUhVdUVoRUtBdmZJSGxVWnJDZ0hOU2NtMG1ES0k4WjF3L04zT3pEazhRbDZr
~ QVVTVVFEM3dVYXU3cVJjK0g3T25UVW82YjJaCiAgICAgICAgREtBMWVNS0hOZzcyOUtmSGoyWk1x QVVTVVFEM3dVYXU3cVJjK0g3T25UVW82YjJaCiAgICAgICAgREtBMWVNS0hOZzcyOUtmSGoyWk1x
~_ ICAgICAgIEgwYndIaGUxR1E9PQo= ICAgICAgIEgwYndIaGUxR1E9PQo=
``` ```

View File

@ -2,7 +2,7 @@
title: Environment Variables title: Environment Variables
series: customization series: customization
hideFromIndex: true hideFromIndex: true
weight: 30 weight: 19
--- ---
Global environment variables to be passed down to all hooks and builds. Global environment variables to be passed down to all hooks and builds.

View File

@ -4,11 +4,14 @@ weight: 2
menu: true menu: true
--- ---
You can install the pre-compiled binary, use Docker or compile from source. You can install the pre-compiled binary (in several different ways),
use Docker or compile from source.
Here are the steps for each of them:
## Install the pre-compiled binary ## Install the pre-compiled binary
**homebrew tap**: **homebrew tap** (only on macOS for now):
```sh ```sh
$ brew install goreleaser/tap/goreleaser $ brew install goreleaser/tap/goreleaser
@ -45,8 +48,8 @@ copy to the desired location.
## Running with Docker ## Running with Docker
You can use Docker to do simple releases. Currently, the provided docker You can also use it within a Docker container. To do that, you'll need to
image does not provide support for snapcraft. execute something more-or-less like the following:
```sh ```sh
$ docker run --rm --privileged \ $ docker run --rm --privileged \
@ -60,33 +63,21 @@ $ docker run --rm --privileged \
goreleaser/goreleaser release goreleaser/goreleaser release
``` ```
> **ATTENTION**: Currently, the provided docker image does not support
> the generation of snapcraft packages.
Note that the image will almost always have the last stable Go version. Note that the image will almost always have the last stable Go version.
The `DOCKER_REGISTRY` environment variables can be left empty when you are The `DOCKER_REGISTRY` environment variable can be left empty when you are
releasing to the public docker registry. releasing to the public docker registry.
If you need more things, you are encouraged to have your own image. You can If you need more things, you are encouraged to keep your own image. You can
always use GoReleaser's [own Dockerfile][dockerfile] as an example though. always use GoReleaser's [own Dockerfile][dockerfile] as an example though
and iterate from that.
[dockerfile]: https://github.com/goreleaser/goreleaser/blob/master/Dockerfile [dockerfile]: https://github.com/goreleaser/goreleaser/blob/master/Dockerfile
[releases]: https://github.com/goreleaser/goreleaser/releases [releases]: https://github.com/goreleaser/goreleaser/releases
## Compiling from source ## Compiling from source
> **Note**: this method requires Go 1.11+. Please follow the relevant steps on our [contributing guide](/contributing).
```sh
$ git clone git@github.com:goreleaser/goreleaser.git
$ cd goreleaser
$ make setup build
```
After that, the `goreleaser` binary will be in the root folder:
```sh
$ ./goreleaser --help
```
For more information, check the [contributing guide][contrib].
[contrib]: /contributing

View File

@ -5,19 +5,12 @@ menu: true
--- ---
[GoReleaser](https://github.com/goreleaser/goreleaser) is a release automation [GoReleaser](https://github.com/goreleaser/goreleaser) is a release automation
tool for Go projects, the goal is to simplify the build, release and tool for Go projects. The goal is to simplify the build, release and
publish steps while providing variant customization options for all steps. publish steps while providing variant customization options for all steps.
GoReleaser is built for CI tools; you only need to GoReleaser is built for CI tools; you only need to
[download and execute it](/ci) in your build script. Of course, you can [download and execute it](/ci) in your build script.
also [install it locally](/install). Of course, you can also [install it locally](/install) if you wish.
You can [customize](/customization) your release process by
creating a `.goreleaser.yml` file.
The idea started with a
[simple shell script](https://github.com/goreleaser/old-go-releaser),
but it quickly became more complex and I also wanted to publish binaries via
Homebrew taps, which would have made the script even more "hacky", so I let
go of that and rewrote the whole thing in Go.
You can also [customize](/customization) your release process through a
`.goreleaser.yml` file.

View File

@ -4,7 +4,7 @@ weight: 10
menu: true menu: true
--- ---
In this example we will build, archive and release a Go project. In this example we will build, archive and release a sample Go project.
Create a GitHub repository and add a single main package: Create a GitHub repository and add a single main package:
@ -19,47 +19,27 @@ func main() {
Run `goreleaser init` to create an example `.goreleaser.yaml` file: Run `goreleaser init` to create an example `.goreleaser.yaml` file:
```console ```sh
$ goreleaser init $ goreleaser init
• Generating .goreleaser.yml file • Generating .goreleaser.yml file
• config created; please edit accordingly to your needs file=.goreleaser.yml • config created; please edit accordingly to your needs file=.goreleaser.yml
``` ```
The generated config file will look like this: You can [customize](/customization) the generated `.goreleaser.yml` or leave
it as-is, it's up to you.
```yml You can test the configuration at any time by running GoReleaser with a few
# This is an example goreleaser.yaml file with some sane defaults. extra parameters to not require a version tag, skip publishing to GitHub,
# Make sure to check the documentation at http://goreleaser.com and remove any already-built files:
builds:
- env:
- CGO_ENABLED=0
archive:
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
```
You can test this initial configuration by running GoReleaser with a few extra parameters to not require a version tag, skip publishing to GitHub, and remove any already-built files: ```sh
```
$ goreleaser --snapshot --skip-publish --rm-dist $ goreleaser --snapshot --skip-publish --rm-dist
``` ```
If you are not using vgo or Go modules, then you will need to comment out the before hooks in the generated config file. Or update them to match your setup accordingly. If you are not using vgo or Go modules, then you will need to comment out the
before hooks in the generated config file or update them to match your setup
accordingly.
GoReleaser will build the binaries for your app for Windows, Linux and macOS, GoReleaser will build the binaries for your app for Windows, Linux and macOS,
both amd64 and i386 architectures. You can customize that by changing the both amd64 and i386 architectures. You can customize that by changing the
@ -67,15 +47,15 @@ both amd64 and i386 architectures. You can customize that by changing the
After building the binaries, GoReleaser will create an archive for each OS/Arch After building the binaries, GoReleaser will create an archive for each OS/Arch
pair into a separate file. You can customize several things by changing pair into a separate file. You can customize several things by changing
the `archive` section, including releasing only the binaries and not creating archives at all. the `archive` section, including releasing only the binaries and not creating
Check the [documentation](/archive) for more information. archives at all. Check the [documentation](/archive) for more information.
You'll need to export a `GITHUB_TOKEN` environment variable, which should You'll need to export a `GITHUB_TOKEN` environment variable, which should
contain a valid GitHub token with the `repo` scope. contain a valid GitHub token with the `repo` scope.
It will be used to deploy releases to your GitHub repository. It will be used to deploy releases to your GitHub repository.
You can create a token [here](https://github.com/settings/tokens/new). You can create a token [here](https://github.com/settings/tokens/new).
```console ```sh
$ export GITHUB_TOKEN=`YOUR_TOKEN` $ export GITHUB_TOKEN=`YOUR_TOKEN`
``` ```
@ -83,7 +63,7 @@ GoReleaser will use the latest
[Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) of your repository. [Git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) of your repository.
Create a tag and push it to GitHub: Create a tag and push it to GitHub:
```console ```sh
$ git tag -a v0.1.0 -m "First release" $ git tag -a v0.1.0 -m "First release"
$ git push origin v0.1.0 $ git push origin v0.1.0
``` ```
@ -95,7 +75,7 @@ based on the latest commit by using the `--snapshot` flag.
Now you can run GoReleaser at the root of your repository: Now you can run GoReleaser at the root of your repository:
```console ```sh
$ goreleaser $ goreleaser
``` ```
@ -112,18 +92,18 @@ The release should look like this:
If you want to test everything before doing a release "for real", you can If you want to test everything before doing a release "for real", you can
use the `--skip-publish` flag, which will only build and package things: use the `--skip-publish` flag, which will only build and package things:
```console ```sh
$ goreleaser release --skip-publish $ goreleaser release --skip-publish
``` ```
You can check the other options by running: You can check the other options by running:
```console ```sh
$ goreleaser --help $ goreleaser --help
``` ```
and and
```console ```sh
$ goreleaser release --help $ goreleaser release --help
``` ```

View File

@ -78,7 +78,7 @@ On Unix systems you can also generate the release notes in-line by using
To list all commits since the last tag, but skip ones starting with `Merge` or To list all commits since the last tag, but skip ones starting with `Merge` or
`docs`, you could run this command: `docs`, you could run this command:
```console ```sh
$ goreleaser --release-notes <(some_changelog_generator) $ goreleaser --release-notes <(some_changelog_generator)
``` ```
@ -86,6 +86,6 @@ Some changelog generators you can use:
- [buchanae/github-release-notes](https://github.com/buchanae/github-release-notes) - [buchanae/github-release-notes](https://github.com/buchanae/github-release-notes)
**Important**: If you create the release before running GoReleaser, and the > **Important**: If you create the release before running GoReleaser, and the
said release has some text in its body, GoReleaser will not override it with > said release has some text in its body, GoReleaser will not override it with
it's release notes. > it's release notes.

View File

@ -14,6 +14,8 @@ object storages ([minio][] for example).
Right now, the implementation is quite simple and probably won't cover all Right now, the implementation is quite simple and probably won't cover all
use cases. If you need one of such use cases, please open an issue/pull request. use cases. If you need one of such use cases, please open an issue/pull request.
Here is what you can customize:
## Customization ## Customization
```yaml ```yaml
@ -54,21 +56,17 @@ You can read the [docs][auth] to find out more about it.
Currently it supports authentication with: Currently it supports authentication with:
* A [EnvProvider][EnvProvider] which retrieves credentials from the environment variables of the - An [EnvProvider][EnvProvider] which retrieves credentials from the environment
running process. Environment credentials never expire. variables of the running process. Environment credentials never expire.
Environment variables used: Environment variables used:
- Access Key ID: `AWS_ACCESS_KEY_ID` or `AWS_ACCESS_KEY`
* Access Key ID: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY - Secret Access Key: `AWS_SECRET_ACCESS_KEY` or `AWS_SECRET_KEY`
- A [SharedCredentialsProvider][SharedCredentialsProvider] which retrieves
* Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY credentials from the current user's home directory, and keeps track if those
credentials are expired. Profile ini file example: `$HOME/.aws/credentials`
* A [SharedCredentialsProvider][SharedCredentialsProvider] which retrieves credentials from the current user's home - A AssumeRoleTokenProvider with enabled SharedConfigState which uses MFA
directory, and keeps track if those credentials are expired. prompting for token code on stdin. Go to [session doc][session] for more
details.
Profile ini file example: $HOME/.aws/credentials
* A AssumeRoleTokenProvider with enabled SharedConfigState which uses MFA prompting for token code on stdin.
Go to [session doc][session] for more details.
You can also set different profile names for each S3 config, so you may be able You can also set different profile names for each S3 config, so you may be able
to push to buckets in different accounts, for example. to push to buckets in different accounts, for example.

View File

@ -61,7 +61,7 @@ foo_template: 'foo_{{ .Env.GOVERSION }}'
And then you can run: And then you can run:
```console ```sh
GOVERSION_NR=$(go version | awk '{print $3;}') goreleaser GOVERSION_NR=$(go version | awk '{print $3;}') goreleaser
``` ```

View File

@ -1,5 +1,5 @@
--- ---
title: Tutorials title: Tutorials and posts
menu: true menu: true
weight: 998 weight: 998
--- ---
@ -7,10 +7,11 @@ weight: 998
Tutorials made by the community. Tutorials made by the community.
<!-- please, keep A-Z sorting --> <!-- please, keep A-Z sorting -->
- [Creating debs and rpms with Go](https://carlosbecker.com/posts/nfpm/)
- [Fast and easy Go binaries delivery](https://carlosbecker.com/posts/goreleaser/)
- [GoReleaser Docker Support](https://carlosbecker.com/posts/goreleaser-docker/)
- [GoReleaser: build and push Snapcraft packages from TravisCI](https://carlosbecker.com/posts/goreleaser-snap-travis/) - [GoReleaser: build and push Snapcraft packages from TravisCI](https://carlosbecker.com/posts/goreleaser-snap-travis/)
- [Shipping Rust Binaries with GoReleaser](https://medium.com/@jondot/shipping-rust-binaries-with-goreleaser-d5aa42a46be0) - [Shipping Rust Binaries with GoReleaser](https://medium.com/@jondot/shipping-rust-binaries-with-goreleaser-d5aa42a46be0)
Want to add your tutorial here? Please do! Edit [this file][tutorials] and open Want to add your tutorial here? Please do! Click on the `improve this page`
a Pull Request! Thanks! link bellow!
[tutorials]: https://github.com/goreleaser/goreleaser/blob/master/www/content/tutorials.md

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

@ -1 +1 @@
Subproject commit 7a952e65f3dcdc1023f35a7faf83b7b70de4631a Subproject commit 14c2f44baa62efc725c2b874f218420909fb2792