Skip to content

Commit bee91ff

Browse files
EliiseSlawrencegripperNicholas M. Iodice
authored
Add ability to make manual releases with goreleaser (#303)
* 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>
1 parent 004d050 commit bee91ff

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ RUN echo "alias tf=terraform" >> "/root/.bashrc"
6060

6161
# Switch back to dialog for any ad-hoc use of apt-get
6262
ENV DEBIAN_FRONTEND=dialog
63+
64+
RUN curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh -s -- "v0.132.1"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ crash.log
1919

2020
# unwanted binary file
2121
**/debug.test
22+
dist
2223

2324

2425
#GoLand Editor configuration

.goreleaser.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This is an example goreleaser.yaml file with some sane defaults.
2+
builds:
3+
- env:
4+
- CGO_ENABLED=0
5+
goos:
6+
- linux
7+
- windows
8+
- darwin
9+
archives:
10+
- format_overrides:
11+
- goos: windows
12+
format: zip
13+
checksum:
14+
name_template: 'checksums.txt'
15+
snapshot:
16+
name_template: "terraform-provider-azuredevops"
17+
changelog:
18+
sort: asc
19+
filters:
20+
exclude:
21+
- '^docs:'
22+
- '^test:'
23+
release:
24+
github:
25+
owner: microsoft
26+
name: terraform-provider-azuredevops

docs/contributing.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,32 @@ Azure DevOps has a rich set of [REST API's](https://docs.microsoft.com/en-us/res
453453

454454
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.
455455

456+
## 8. Creating a release
457+
458+
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.
459+
To be able to make the release you need to have the required permissions to create a release for this project or a fork.
460+
461+
> To make the release for your fork change the `owner` in `.goreleaser.yml` to be the name of the account holding the fork.
462+
463+
Making the release:
464+
1. Open this project in the dev container or [install gorelaser](https://goreleaser.com/install/)
465+
1. Create a Github PAT token with all of the `Repo` permissions
466+
1. Set `GITHUB_TOKEN` enviorment variable to the above PAT token
467+
```bash
468+
export GITHUB_TOKEN=<Your PAT token>
469+
```
470+
1. Set the release version you would like to create
471+
```bash
472+
RELEASE_VERSION="v0.1.7"
473+
```
474+
1. Create
475+
```bash
476+
git tag $RELEASE_VERSION && ./bin/goreleaser release --rm-dist
477+
478+
```
479+
480+
> More information about using goreleaser here: https://goreleaser.com/
481+
456482
# Note about CLA
457483

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

0 commit comments

Comments
 (0)