Skip to content

Commit

Permalink
Try no changelog on pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Feb 26, 2024
1 parent b84e9a0 commit 8618ff6
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ on:
required: true
type: string
default: "main"
tc_keep:
description: "Remove towncrier fragments"
pre_release:
description: "Pre-release? (Don't render changelog)"
required: true
type: boolean
default: true
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -30,6 +30,14 @@ jobs:
pre_release_tasks:
runs-on: ubuntu-latest
steps:
- name: Validate input
run: |
if [[ ${{ inputs.version }} = v* ]]
then
echo "::error title=Invalid Version::Invalid version number given"
exit 1
fi
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down Expand Up @@ -91,8 +99,9 @@ jobs:
echo "${{ steps.markdown-changelog.outputs.content }}"
- name: Run towncrier
if: ${{ ! inputs.pre_release }}
run: |
towncrier build --version ${{ inputs.version }} ${{ inputs.tc_keep && '--yes' || '--keep' }}
towncrier build --version ${{ inputs.version }} --yes
- name: Run pre-commit
run: |
Expand All @@ -102,7 +111,7 @@ jobs:
- name: Commit Changelog
run: |
git commit -m "Render changelog for v${{ inputs.version }}"
git diff-index --quiet HEAD -- || git commit -m "Render changelog for v${{ inputs.version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand All @@ -127,5 +136,6 @@ jobs:
tag_name: "v${{ inputs.version }}",
name: "v${{ inputs.version }}",
body: `${{ steps.markdown-changelog.outputs.content }}`,
draft: true
draft: true,
prerelease: ${{ inputs.pre_release }}
});

0 comments on commit 8618ff6

Please sign in to comment.