Skip to content

Commit

Permalink
Merge pull request #58 from grafeas/release-actions
Browse files Browse the repository at this point in the history
Release v2.7.0 via GitHub Actions
  • Loading branch information
thepwagner authored Jan 4, 2022
2 parents b296cb6 + 9a7fdef commit a78ca73
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 31 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
tags: [ 'v*.*.*' ]

permissions:
contents: write
packages: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Extract release changelog
run: |
version=${GITHUB_REF#refs/tags/v*}
mkdir -p tmp
sed '/^# '$version'/,/^# /!d;//d;/^\s*$/d' CHANGELOG.md > tmp/release_changelog.md
- name: Release
uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2
with:
distribution: goreleaser
version: v1.2.1
args: release --rm-dist --release-notes=tmp/release_changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ coverage.txt
# build output
dist
build
/tmp
2 changes: 0 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ changelog:
exclude:
- '^docs:'
- '^test:'
release:
disable: true
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Unreleased

* Nothing!

# 2.7.0

* Support for authentication when Voucher is hosted as a Google CloudRun service (#45, #48, #49, #53, #54, #57)
* Client send `User-Agent` header when making HTTP requests (#52)
* Server avoid leaking `containeranalysis.Client` (#50)

# 2.6.2

* Introduce bodyclose linter (#46)
42 changes: 13 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,24 @@ $ git push -u <your username> <the name of your branch>
are adding code which would be untested, please consider adding tests to cover
that code.

- For new features or changes users should be aware of, add an entry to `CHANGELOG.md`.

- Open a PR against grafeas/voucher

## Making a release

If you are maintaining the Voucher project you can make a release of Voucher
using `goreleaser`.

First, update the master branch to the commit that you'd like to create a
First, update the default branch to the commit that you'd like to create a
release for.

```shell
$ git checkout master
$ git checkout main
$ git pull
```

If everything looks good, create a new tag. Voucher uses
If everything looks good, decide the new version. Voucher uses
[Semantic Versioning](https://semver.org) which basically means that API
compatible changes should bump the last digit, backwards compatible changes
should bump the second, and API incompatible changes should bump the first
Expand All @@ -91,7 +93,12 @@ we can bump from v1.0.0 to v1.0.1. If the change is backwards compatible with
the previous version, we can bump from v1.0.0 to v1.1.0. If the change is
not backwards compatible, we must bump the version from v1.0.0 to v2.0.0.

Run the following, where `version` is replaced with the appropriate version for
Edit the `CHANGELOG.md`:
* Move the `Unreleased` section to the version chosen above.
* Keep a blank `Unreleased` section at the top of the file.
* Commit and [send in your changes](#send-in-your-changes), including the reason you selected the target version.

Once your changes are approved, run the following, where `version` is replaced with the appropriate version for
this release.

(Note that you will need to have Git configured to sign tags with
Expand All @@ -101,34 +108,11 @@ your OpenPGP key or this command will fail.)
$ git tag -s <version>
```

Before pushing your tag, build a release version of Voucher to ensure that
everything builds properly:

```shell
$ make release
```

If this step fails, please do not make a release without fixing it. In
addition, please delete the tag so it can be replaced once the issue is
fixed.

If this step is successful, the ready-to-be released files will be found
under `dist/`.

Next, push the tag to the server, where `version` is the same version you
Push the tag to the server, where `version` is the same version you
specified before:

```shell
$ git push origin refs/tags/<version>
```

Finally, create a new release in GitHub for the new version for the tag you
created and signed. In the `dist/` directory you will find the automatically
generated binary tar archives and `checksums.txt` file, which will need to
be added to the release in GitHub.

In the release description, paste the output of the `CHANGELOG.md` file,
also automatically generated in `dist/`. This should be touched up to
remove unnecessary commit descriptions.

Once you're ready, publish the release and tell everyone about it!
Once pushed, the release will be published automatically by goreleaser running in GitHub Actions.

0 comments on commit a78ca73

Please sign in to comment.