From 7014cc53d5db21a58ba370ce798345940b79c955 Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Thu, 13 May 2021 12:11:53 +0100 Subject: [PATCH] Update RELEASE process (#275) * Update RELEASE process * Update RELEASE.md Co-authored-by: Dora Militaru * Update RELEASE.md Co-authored-by: Dora Militaru * Use footnotes * Darwin arm64 requires updated goreleaser Co-authored-by: Dora Militaru --- .github/workflows/tag_release.yml | 16 +++--------- .goreleaser.yml | 3 ++- RELEASE.md | 43 +++++++++++-------------------- 3 files changed, 20 insertions(+), 42 deletions(-) diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index 22a8a44a7..f62c40e06 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -11,28 +11,18 @@ jobs: uses: actions/checkout@v2 - name: Unshallow run: git fetch --prune --unshallow - - name: Install Go + - name: Set up Go uses: actions/setup-go@v2 with: go-version: '1.16.x' - name: Set GOVERSION id: set_goversion run: echo "GOVERSION=$(go version)" >> $GITHUB_ENV - - name: Install Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.7' - - name: Install github_changelog_generator - run: gem install github_changelog_generator -v 1.15.0 - - name: Generate Release changelog - run: make release-changelog - env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: - version: v0.155.2 # goreleaser version (NOT goreleaser-action version) - args: release --rm-dist --release-notes=RELEASE_CHANGELOG.md + version: v0.164.0 # goreleaser version (NOT goreleaser-action version) + args: release --rm-dist env: GOVERSION: ${{ env.GOVERSION }} GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 91d1cea4e..43a1e0bd6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,6 @@ project_name: fastly release: + draft: true prerelease: auto extra_files: - glob: "dist/usage.json" @@ -92,4 +93,4 @@ checksum: snapshot: name_template: "{{ .Tag }}-next" changelog: - sort: asc + skip: true diff --git a/RELEASE.md b/RELEASE.md index a19a074a8..0231e5617 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,31 +1,18 @@ -# Releasing +# Release Process -### How to cut a new release of the CLI +1. Merge all PRs intended for the release. +2. Rebase latest remote main branch locally (`git pull --rebase origin main`). +3. Ensure all analysis checks and tests are passing (`make all`). +4. Open a new PR to update CHANGELOG ([example](https://github.com/fastly/cli/pull/273))[1](#note1). +5. Merge CHANGELOG. +6. Rebase latest remote main branch locally (`git pull --rebase origin main`). +7. Tag a new release (`git tag -s vX.Y.Z -m "vX.Y.Z" && git push origin vX.Y.Z`)[2](#note2). +8. Copy/paste CHANGELOG into the [draft release](https://github.com/fastly/cli/releases). +9. Publish draft release. +10. Communicate the release in the relevant Slack channels[3](#note3). -This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html); therefore first determine the appropriate version tag based on the change set. If in doubt discuss with the team via Slack before releasing. +## Footnotes -1. Merge all PRs intended for the release into the `main` branch -1. Checkout and update the main branch and ensure all tests are passing: - * `git checkout main` - * `git pull` - * `make all` -1. Update the [`CHANGELOG.md`](https://github.com/fastly/cli/blob/main/CHANGELOG.md): - * Apply necessary labels (`enchancement`, `bug`, `documentation` etc) to all PRs intended for the release that you wish to appear in the `CHANGELOG.md` - * **Only add labels for relevant changes** - * `git checkout -b vx.x.x` where `vx.x.x` is your target version tag - * `CHANGELOG_GITHUB_TOKEN=xxxx SEMVER_TAG=vx.x.x make changelog` - * **Known Issue**: We've found that the diffs generated are non-deterministic. Just re-run `make changelog` until you get a diff with just the newest additions. For more details, visit [this link](https://github.com/github-changelog-generator/github-changelog-generator/issues/580#issuecomment-380952266). - * `git add CHANGELOG.md && git commit -m "vx.x.x"` -1. Send PR for the `CHANGELOG.md` -1. Once approved and merged, checkout and update the `main` branch: - * `git checkout main` - * `git pull` -1. Create a new tag for `main`: - * `git tag -s vx.x.x -m "vx.x.x"` -1. Push the new tag: - * `git push origin vx.x.x` -1. Go to GitHub and check that the release was successful: - * Check the release CI job status via the [Actions](https://github.com/fastly/cli/actions?query=workflow%3ARelease) tab - * Check the release exists with valid assets and changelog: https://github.com/fastly/cli/releases -1. Announce release internally via Slack -1. Celebrate :tada: +1. We utilize [semantic versioning](https://semver.org/) and only include relevant/significant changes within the CHANGELOG. +2. Triggers a [github action](https://github.com/fastly/cli/blob/main/.github/workflows/tag_release.yml) that produces a 'draft' release. +3. Fastly make internal announcements in the Slack channels: `#api-clients`, `#ecp-languages`.