Skip to content

Commit

Permalink
Add ability to make manual releases with goreleaser (#303)
Browse files Browse the repository at this point in the history
* Adding goreleaser

* Adding release to fork

* Add windows build

* Move to publish .zip for windows

* Change owner

Co-authored-by: Lawrence Gripper <info@grippers.co.uk>

* Add documentation

Co-authored-by: Lawrence Gripper <info@grippers.co.uk>
Co-authored-by: Nicholas M. Iodice <niiodice@microsoft.com>
  • Loading branch information
3 people authored May 10, 2020
1 parent 004d050 commit bee91ff
Showing 4 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -60,3 +60,5 @@ RUN echo "alias tf=terraform" >> "/root/.bashrc"

# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog

RUN curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh -s -- "v0.132.1"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ crash.log

# unwanted binary file
**/debug.test
dist


#GoLand Editor configuration
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This is an example goreleaser.yaml file with some sane defaults.
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
archives:
- format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "terraform-provider-azuredevops"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
github:
owner: microsoft
name: terraform-provider-azuredevops
26 changes: 26 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -453,6 +453,32 @@ Azure DevOps has a rich set of [REST API's](https://docs.microsoft.com/en-us/res

If you find an api is missing from the postman collection, please submit a PR. We intend make the collection as complete as possible over time.

## 8. Creating a release

You can create a github release of this project or a fork of this project using goreleaser. The gorelease will create binaries for Mac, Linux and Windows based of the fork you're making the release from.
To be able to make the release you need to have the required permissions to create a release for this project or a fork.

> To make the release for your fork change the `owner` in `.goreleaser.yml` to be the name of the account holding the fork.
Making the release:
1. Open this project in the dev container or [install gorelaser](https://goreleaser.com/install/)
1. Create a Github PAT token with all of the `Repo` permissions
1. Set `GITHUB_TOKEN` enviorment variable to the above PAT token
```bash
export GITHUB_TOKEN=<Your PAT token>
```
1. Set the release version you would like to create
```bash
RELEASE_VERSION="v0.1.7"
```
1. Create
```bash
git tag $RELEASE_VERSION && ./bin/goreleaser release --rm-dist
```

> More information about using goreleaser here: https://goreleaser.com/

# Note about CLA

This project welcomes contributions and suggestions. Most contributions require you to agree to a

0 comments on commit bee91ff

Please sign in to comment.