Skip to content

chore: move changelog to tag workflow #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/do-prioritize-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ jobs:
uses: weibullguy/get-labels-action@main

- name: Add High Urgency Labels
if: '${{ (contains(steps.getlabels.outputs.labels, "C: convention") && contains (steps.getlabels.outputs.labels, "P: bug")) }}'
if: "${{ (contains(steps.getlabels.outputs.labels, 'C: convention') && contains (steps.getlabels.outputs.labels, 'P: bug')) }}"
uses: andymckay/labeler@master
with:
add-labels: "U: high"

- name: Add Medium Urgency Labels
if: '${{ (contains(steps.getlabels.outputs.labels, "C: style") && contains(steps.getlabels.outputs.labels, "P: bug")) || (contains(steps.getlabels.outputs.labels, "C: stakeholder") && contains(steps.getlabels.outputs.labels, "P: bug")) || (contains(steps.getlabels.outputs.labels, "C: convention") && contains(steps.getlabels.outputs.labels, "P: enhancement")) }}'
if: "${{ (contains(steps.getlabels.outputs.labels, 'C: style') && contains(steps.getlabels.outputs.labels, 'P: bug')) || (contains(steps.getlabels.outputs.labels, 'C: stakeholder') && contains(steps.getlabels.outputs.labels, 'P: bug')) || (contains(steps.getlabels.outputs.labels, 'C: convention') && contains(steps.getlabels.outputs.labels, 'P: enhancement')) }}"
uses: andymckay/labeler@master
with:
add-labels: "U: medium"

- name: Add Low Urgency Labels
if: '${{ (contains(steps.getlabels.outputs.labels, "C: style") && contains(steps.getlabels.outputs.labels, "P: enhancement")) || (contains(steps.getlabels.outputs.labels, "C: stakeholder") && contains(steps.getlabels.outputs.labels, "P: enhancement")) || contains(steps.getlabels.outputs.labels, "doc") || contains(steps.getlabels.outputs.labels, "chore") }}'
if: "${{ (contains(steps.getlabels.outputs.labels, 'C: style') && contains(steps.getlabels.outputs.labels, 'P: enhancement')) || (contains(steps.getlabels.outputs.labels, 'C: stakeholder') && contains(steps.getlabels.outputs.labels, 'P: enhancement')) || contains(steps.getlabels.outputs.labels, 'doc') || contains(steps.getlabels.outputs.labels, 'chore') }}"
uses: andymckay/labeler@master
with:
add-labels: "U: low"
44 changes: 0 additions & 44 deletions .github/workflows/do-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,50 +41,6 @@ jobs:
echo "version=$(echo $(poetry version | cut -d' ' -f2))" >> $GITHUB_OUTPUT
echo "do_release=1" >> $GITHUB_ENV

- name: Generate release changelog
uses: heinrichreimer/github-changelog-generator-action@master
if: ${{ env.do_release == 1 }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: "v1.3.1"
excludeTagsRegex: "-rc[0-9]"
breakingLabel: "Breaking Changes"
breakingLabels: "V: major"
enhancementLabel: "Features"
enhancementLabels: "P: enhancement"
bugsLabel: "Bug Fixes"
bugLabels: "P: bug"
excludeLabels: "release"
issues: false
issuesWoLabels: false
maxIssues: 100
pullRequests: true
prWoLabels: false
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true

- name: Check if diff
if: ${{ env.do_release == 1 }}
continue-on-error: true
run: >
git diff --exit-code CHANGELOG.md &&
(echo "### No update" && exit 1) || (echo "### Commit update")

- uses: EndBug/add-and-commit@v9
name: Commit and push if diff
if: ${{ env.do_release == 1 }}
with:
add: CHANGELOG.md
message: 'chore: update CHANGELOG.md for new release'
author_name: GitHub Actions
author_email: action@github.com
committer_name: GitHub Actions
committer_email: actions@github.com
push: true

- name: Build release
id: build
if: ${{ env.do_release == 1 }}
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/on-push-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,74 @@ on:
- 'v*'

jobs:
update_changelog:
name: Update Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: master

- name: Get new tag
id: newversion
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=$(echo $tag | sed 's/-rc[0-9]*//')
if [[ $tag != *"-rc"* ]]; then
echo "do_changelog=1" >> $GITHUB_ENV
echo "tag=$(echo $tag)" >> $GITHUB_OUTPUT
echo "version=$(echo $version)" >> $GITHUB_OUTPUT
fi
echo "New tag is: $tag"
echo "New version is: $version"
echo "GitHub ref: ${{ github.ref }}"

- name: Generate release changelog
uses: heinrichreimer/github-changelog-generator-action@master
if: ${{ env.do_changelog == 1 }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
sinceTag: "v1.3.1"
excludeTagsRegex: "-rc[0-9]"
breakingLabel: "Breaking Changes"
breakingLabels: "V: major"
enhancementLabel: "Features"
enhancementLabels: "P: enhancement"
bugsLabel: "Bug Fixes"
bugLabels: "P: bug"
excludeLabels: "release"
issues: false
issuesWoLabels: false
maxIssues: 100
pullRequests: true
prWoLabels: false
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true

- name: Check if diff
if: ${{ env.do_changelog == 1 }}
continue-on-error: true
run: >
git diff --exit-code CHANGELOG.md &&
(echo "### No update" && exit 1) || (echo "### Commit update")

- uses: EndBug/add-and-commit@v9
name: Commit and push if diff
if: ${{ env.do_changelog == 1 }}
with:
add: CHANGELOG.md
message: 'chore: update CHANGELOG.md for new release'
author_name: GitHub Actions
author_email: action@github.com
committer_name: GitHub Actions
committer_email: actions@github.com
push: true

manage_milestones:
name: Manage Milestones
runs-on: ubuntu-latest
Expand Down