Skip to content

Commit

Permalink
build: allow milestones to be rereleased #453
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Jan 30, 2023
1 parent 30d6c83 commit 64c2f17
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
11 changes: 1 addition & 10 deletions .github/actions/check_milestone/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ outputs:
runs:
using: composite
steps:
- name: Get tag uniqueness
id: unique_tag
uses: mukunku/tag-exists-action@v1.2.0 # wildcard version @v1 not possible
env:
MILESTONE: ${{ inputs.milestone }}
with:
tag: ${{ env.MILESTONE }}

- name: Get closed issues for milestone
id: closed_issues
uses: octokit/graphql-action@v2.x
Expand Down Expand Up @@ -93,7 +85,7 @@ runs:
id: outcome
shell: bash
run: |
if [ "${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 && fromJSON(steps.open_issues.outputs.data).search.issueCount == 0 && steps.unique_tag.outputs.exists == 'false' && ( (steps.patchvers.outputs.value!='0'&&steps.hasoldnotes.outputs.value=='1') || (steps.patchvers.outputs.value=='0'&&steps.hasoldnotes.outputs.value!='1') ) }}" = "true" ]; then
if [ "${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 && fromJSON(steps.open_issues.outputs.data).search.issueCount == 0 && ( (steps.patchvers.outputs.value!='0'&&steps.hasoldnotes.outputs.value=='1') || (steps.patchvers.outputs.value=='0'&&steps.hasoldnotes.outputs.value!='1') ) }}" = "true" ]; then
echo "outcome=success" >> $GITHUB_OUTPUT
else
echo "outcome=failure" >> $GITHUB_OUTPUT
Expand All @@ -103,7 +95,6 @@ runs:
shell: bash
run: |
echo outcome : ${{ steps.outcome.outputs.outcome }}
echo has unique tag : ${{ steps.unique_tag.outputs.exists == 'false' }}
echo has closed issues : ${{ fromJSON(steps.closed_issues.outputs.data).search.issueCount > 0 }}
echo has open issues : ${{ fromJSON(steps.open_issues.outputs.data).search.issueCount > 0 }}
echo is patch version : ${{ steps.patchvers.outputs.value != '0' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/release_milestone/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ runs:

- name: Close milestone
uses: Akkjon/close-milestone@v2
continue-on-error: true
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down Expand Up @@ -149,6 +150,7 @@ runs:
- name: Create next patch milestone
uses: WyriHaximus/github-action-create-milestone@v1
continue-on-error: true
env:
MILESTONE: ${{ inputs.milestone }}
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
5 changes: 3 additions & 2 deletions exampleSite/content/dev/maintaining/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Once working on an issue, assign it to a fitting maintainer.

When done, close the ticket. Once an issue is closed, it needs to be assigned to next release milestone.

A once released ticket is not allowed to be reopened and rereleased in a different release. Write a new ticket in this case.
A once released ticket is not allowed to be reopened and rereleased in a different milestone. This would cause the changelog to be changed even for the milestone the issue was previously released in. Instead write a new ticket.

## Managing Pull Requests

Expand Down Expand Up @@ -97,14 +97,15 @@ A release is based on a milestone named like the release itself - just the versi

Making releases is automated by the `version-release` GitHub Action. It requires the version number of the milestone that should be released. The release will be created from the `main` branch of the repository.

Treat released milestones as immutable. Don't rerelease an already released milestone. An already released milestone may already been consumed by your users.

During execution of the action a few things are checked. If a check fails the action fails, resulting in no new release. You can correct the errors afterwards and rerun the action.

The following checks will be enforced

- the milestone exists
- there is at least one closed issue assigned to the milestone
- all assigned issues for this milestone are closed
- the milestone is not previously released
- if it's a main release, there must be a new `<major>.<minor>` at the beginning of the [What's new]({{% relref "basics/migration" %}}) page
- if it's a patch release, there must be the `<major>.<minor>` from the previous release at the beginning of the [What's new]({{% relref "basics/migration" %}}) page

Expand Down
1 change: 0 additions & 1 deletion exampleSite/content/more/credits/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Many thanks to [Andy Miller](https://github.com/rhukster) for initially creating
- https://github.com/ashley-taylor/regex-property-action
- https://github.com/Kaven-Universe/github-action-current-date-time
- https://github.com/mingjun97/file-regex-replace
- https://github.com/mukunku/tag-exists-action
- https://github.com/octokit/graphql-action
- https://github.com/peaceiris/actions-gh-pages
- https://github.com/peaceiris/actions-hugo
Expand Down

0 comments on commit 64c2f17

Please sign in to comment.