Skip to content

Commit

Permalink
Add steps to automate changelog generation to Makefile and CI workflo…
Browse files Browse the repository at this point in the history
…w. (#23)
  • Loading branch information
phamann authored Apr 22, 2020
1 parent 7cdba2c commit c77616b
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,39 @@ jobs:
- name: Set GOVERSION
run: |
echo "::set-env name=GOVERSION::$(go version)"
- 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 changelogs
run: make changelog release-changelog
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: "v0.131.1"
args: release --rm-dist
version: 'v0.131.1'
args: release --rm-dist --release-notes=RELEASE_CHANGELOG.md
env:
GOVERSION: ${{ env.GOVERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set GIT_TAG
run: |
echo "::set-env name=GIT_TAG::${GITHUB_REF/refs\/tags\//}"
- name: Commit CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COMMIT_MSG: |
Release ${GIT_TAG}
skip-checks: true
run: |
git config user.email "oss@fastly.com"
git config user.name "Release bot"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git checkout master
git add CHANGELOG.md
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin master)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
fastly
!cmd/fastly

RELEASE_CHANGELOG.md

# Fastly package format files
**/fastly.toml
!pkg/compute/testdata/build/fastly.toml
Expand Down
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Changelog

## [v0.5.0](https://github.com/fastly/cli/releases/tag/v0.5.0) (2020-04-08)

[Full Changelog](https://github.com/fastly/cli/compare/v0.4.1...v0.5.0)

**Enhancements:**

- Add the ability to initialise a compute project from a specific branch [\#14](https://github.com/fastly/cli/pull/14)

## [v0.4.1](https://github.com/fastly/cli/releases/tag/v0.4.1) (2020-03-27)

[Full Changelog](https://github.com/fastly/cli/compare/v0.4.0...v0.4.1)

**Bug fixes:**

- Fix persistence of author string to fastly.toml [\#12](https://github.com/fastly/cli/pull/12)
- Fix up undoStack.RunIfError [\#11](https://github.com/fastly/cli/pull/11)

## [v0.4.0](https://github.com/fastly/cli/releases/tag/v0.4.0) (2020-03-20)

[Full Changelog](https://github.com/fastly/cli/compare/v0.3.0...v0.4.0)

**Enhancements:**

- Add commands for S3 logging endpoints [\#9](https://github.com/fastly/cli/pull/9)
- Add useful next step links to compute deploy [\#8](https://github.com/fastly/cli/pull/8)
- Persist version to manifest file when deploying compute services [\#7](https://github.com/fastly/cli/pull/7)

**Bug fixes:**

- Fix comment for --use-ssl flag [\#6](https://github.com/fastly/cli/pull/6)

## [v0.3.0](https://github.com/fastly/cli/releases/tag/v0.3.0) (2020-03-11)

[Full Changelog](https://github.com/fastly/cli/compare/v0.2.0...v0.3.0)

**Enhancements:**

- Interactive init [\#5](https://github.com/fastly/cli/pull/5)

## [v0.2.0](https://github.com/fastly/cli/releases/tag/v0.2.0) (2020-02-24)

[Full Changelog](https://github.com/fastly/cli/compare/v0.1.0...v0.2.0)

**Enhancements:**

- Improve toolchain installation help messaging [\#3](https://github.com/fastly/cli/pull/3)

**Bug fixes:**

- Filter unwanted files from template repository whilst initialising [\#1](https://github.com/fastly/cli/pull/1)

## [v0.1.0](https://github.com/fastly/cli/releases/tag/v0.1.0) (2020-02-05)

[Full Changelog](https://github.com/fastly/cli/compare/5a8d21b6b1973abe7a27f985856d910f4396ce95...v0.1.0)

Initial release :tada:



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
26 changes: 26 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SHELL := /bin/bash -o pipefail

LAST_SEMVER_TAG := $(shell git tag | sort -r --version-sort | egrep '^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$$' | head -n1)

.PHONY: all
all: fmt vet staticcheck lint gosec test build install

Expand Down Expand Up @@ -40,3 +42,27 @@ build:
.PHONY: install
install:
go install ./cmd/fastly

.PHONY:
changelog:
github_changelog_generator -u fastly -p cli \
--no-pr-wo-labels \
--no-author \
--enhancement-label "**Enhancements:**" \
--bugs-label "**Bug fixes:**" \
--release-url "https://github.com/fastly/cli/releases/tag/%s" \
--exclude-labels documentation \
--exclude-tags-regex "v.*-.*"

.PHONY:
release-changelog:
github_changelog_generator -u fastly -p cli \
--no-pr-wo-labels \
--no-author \
--no-issues \
--enhancement-label "**Enhancements:**" \
--bugs-label "**Bug fixes:**" \
--release-url "https://github.com/fastly/cli/releases/tag/%s" \
--exclude-labels documentation \
--output RELEASE_CHANGELOG.md \
--since-tag $(LAST_SEMVER_TAG)

0 comments on commit c77616b

Please sign in to comment.