Skip to content

Commit

Permalink
Merge pull request #2037 from weaveworks/release-release-notes
Browse files Browse the repository at this point in the history
release: Thread release notes into the PR, too
  • Loading branch information
Robin Sonefors committed Apr 28, 2022
2 parents b307b80 + 27dbe89 commit 55897c6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 11 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,20 @@ jobs:
git commit -am "Update helm chart to $NEW_CHART_VERSION to use gitops $GITOPS_VERSION"
if: ${{ !contains(github.event.inputs.version, '-') }}

- name: Set tag for building changelog
run: |
git config user.name weave-gitops-bot
git config user.email weave-gitops-bot@weave.works
git tag -a ${{ github.event.inputs.version }} -m ${{ github.event.inputs.version }}
# Do not push tag - we'll push it when approved
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: "${{ github.workspace }}/.github/changelog/changelog_configuration.json"
ignorePreReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
id: create-pull-request
uses: peter-evans/create-pull-request@v4
Expand All @@ -81,6 +94,27 @@ jobs:
branch: ${{ env.BRANCH }}
base: main
title: "Updates for ${{ env.GITOPS_VERSION }}"
body: "Update version references to ${{ env.GITOPS_VERSION }}"
body: |
Breaking changes: Describe any breaking changes here, or delete this block
Action required: Describe any user facing actions here, or delete this block.
Features and improvements: Describe any user facing changes here, or delete this block.
Examples of user facing changes:
- API changes
- Bug fixes
- Any changes in behaviour
- Changes requiring upgrade notices or deprecation warning
${{ steps.github_release.outputs.changelog }}
token: ${{ secrets.WEAVE_GITOPS_BOT_ACCESS_TOKEN }}
labels: "exclude from release notes"
- name: "Comment on pull request"
run: |
curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues/${{ steps.create-pull-request.outputs.pull-request-number }}/comments \
--header 'authorization: Bearer ${{ secrets.WEAVE_GITOPS_BOT_ACCESS_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"body": "To change the release notes, edit the pull request description. As soon as you approve the PR, the release will start, and will be automatically merged when finished"
}'
14 changes: 5 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,14 @@ jobs:
run: make all
- name: Check Git State
run: git diff --no-ext-diff --exit-code
- name: Build Changelog
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: "${{ github.workspace }}/.github/changelog/changelog_configuration.json"
outputFile: "${{ runner.temp }}/changelog.md"
ignorePreReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Include brew publishing
run: cat .goreleaser.brew.yml >> .goreleaser.yml
if: ${{ !contains(github.event.pull_request.head.ref, '-') }}
- name: Store changelog
run: |
echo > ${{ runner.temp }}/changelog.md <<END_OF_CHANGELOG
${{ github.event.pull_request.body }}
END_OF_CHANGELOG
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
Expand Down

0 comments on commit 55897c6

Please sign in to comment.