From 218d14f55eb7f7b6de88f69fa4105dcfa12191e0 Mon Sep 17 00:00:00 2001 From: Peter Wagner <peter.wagner@shopify.com> Date: Tue, 21 Dec 2021 14:20:39 -0500 Subject: [PATCH 1/4] release from GitHub Actions --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 2 -- CHANGELOG.md | 13 +++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..3ca7f6f8 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 sed '/^# '$version'/,/^# /!d;//d;/^\s*$/d' CHANGELOG.md > tmp/release_changelog.md + - name: Release + uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2 + with: + distribution: goreleaser + version: v1.1.0 + args: release --rm-dist --release-notes=tmp/release_changelog.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml index b8650f36..20b6299e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -68,5 +68,3 @@ changelog: exclude: - '^docs:' - '^test:' -release: - disable: true diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..68ef7e36 --- /dev/null +++ b/CHANGELOG.md @@ -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) From 0f3e7b4f1934a704026b230fd0e555da88e4d241 Mon Sep 17 00:00:00 2001 From: Peter Wagner <peter.wagner@shopify.com> Date: Tue, 21 Dec 2021 14:30:29 -0500 Subject: [PATCH 2/4] CONTRIBUTING: actions releases --- CONTRIBUTING.md | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ec3ca96..f7c192d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,6 +67,8 @@ $ 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 @@ -74,15 +76,15 @@ that code. 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 @@ -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 @@ -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. From 2a97a176180ae3734199ec6bdfa02e9a101c1e24 Mon Sep 17 00:00:00 2001 From: Pete Wagner <1559510+thepwagner@users.noreply.github.com> Date: Wed, 22 Dec 2021 10:56:23 -0500 Subject: [PATCH 3/4] goreleaser-v1.2.1 Co-authored-by: Dani Santos <daniele.santos@shopify.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ca7f6f8..cea48dd6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2 with: distribution: goreleaser - version: v1.1.0 + version: v1.2.1 args: release --rm-dist --release-notes=tmp/release_changelog.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 9a7fdef6951d6dd6d214bb89b0ae1c11d1acbeab Mon Sep 17 00:00:00 2001 From: Peter Wagner <peter.wagner@shopify.com> Date: Wed, 22 Dec 2021 13:25:04 -0500 Subject: [PATCH 4/4] fix: bad paste in changelog generation --- .github/workflows/release.yml | 2 +- .gitignore | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cea48dd6..05212c95 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: run: | version=${GITHUB_REF#refs/tags/v*} mkdir -p tmp - sed sed '/^# '$version'/,/^# /!d;//d;/^\s*$/d' CHANGELOG.md > tmp/release_changelog.md + sed '/^# '$version'/,/^# /!d;//d;/^\s*$/d' CHANGELOG.md > tmp/release_changelog.md - name: Release uses: goreleaser/goreleaser-action@5df302e5e9e4c66310a6b6493a8865b12c555af2 with: diff --git a/.gitignore b/.gitignore index c219dbb7..45176a50 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ coverage.txt # build output dist build +/tmp \ No newline at end of file