Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use init-release task to generate goreleaser file #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions recipes/go-github-release/.dunner.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
init-release:
- image: goreleaser/goreleaser
commands:
- ["goreleaser", "init"]

generate-artifacts:
- image: goreleaser/goreleaser
commands:
- ["goreleaser", "release", "--snapshot", "--skip-publish", "--rm-dist"]

go-github-release:
- image: goreleaser/goreleaser
commands:
- ["goreleaser", "release"]
- ["goreleaser", "release", "--snapshot", "--rm-dist"]
envs:
- GITHUB_TOKEN=`$GITHUB_TOKEN`
mounts:
- ".:/app"
40 changes: 0 additions & 40 deletions recipes/go-github-release/.goreleaser.yml

This file was deleted.

17 changes: 12 additions & 5 deletions recipes/go-github-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,23 @@ Run below command in root directory of Project.
$ dunner init go-github-release
```

This recipe creates a dunner task file `.dunner.yml` and also `.goreleaser.yml` which contains Github Release information. Edit it accordingly.
This recipe creates a dunner task file `.dunner.yml` which contains task to trigger release.

To set the version of your project add git tag and push it to master branch remote.
* Run below task to create goreleaser configuration file and edit it accordingly.

```
$ git tag -a <version> -m "Release version <version>"
$ git push origin <version>
$ dunner do init-release
```

Run below command from project root directory to make the Github release with all binaries of your project along with generated Changelog and source code.
To set the version of your project add git tag or pass `--snapshot` flag to goreleaser to use commit sha.

* To generate artifacts and not publish it to Github, run below task:

```
$ dunner do generate-artifacts
```

* Run below command to make the Github release with all binaries of your project along with generated Changelog. Make sure to set the GITHUB_TOKEN in environment.

```
$ dunner do go-github-release
Expand Down
21 changes: 14 additions & 7 deletions recipes/go-github-release/metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,27 @@ name: go-github-release
description: "Dunner recipe for GitHub release of Go Projects"
version: "0.1.0"

preInstallCmd: "curl -O https://raw.githubusercontent.com/leopardlabs/dunner-cookbook/master/recipes/go-github-release/.goreleaser.yml"
preInstallCmd: ""

postInstallMessage: |
This recipe creates a dunner task file `.dunner.yaml` and also `.goreleaser.yml` which contains Github Release information. Edit it accordingly.
This recipe creates a dunner task file `.dunner.yml` which contains task to trigger release.

To set the version of your project add git tag and push it to master branch remote.
* Run below task to create goreleaser configuration file and edit it accordingly.

```
$ git tag -a <version> -m "Release version <version>"
$ git push origin <version>
```
$ dunner do init-release
```

Run below command from project root directory to make the Github release with all binaries of your project along with generated Changelog and source code.
To set the version of your project add git tag or pass `--snapshot` flag to goreleaser to use commit sha.

* To generate artifacts and not publish it to Github, run below task:

```
$ dunner do generate-artifacts
```

* Run below command to make the Github release with all binaries of your project along with generated Changelog. Make sure to set the GITHUB_TOKEN in environment.

```
$ dunner do go-github-release
```