Skip to content

Commit

Permalink
More pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Cadair committed Feb 19, 2024
1 parent 50209a8 commit 7343e99
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,23 @@ jobs:
git diff-index --quiet HEAD -- || git commit -m "Update attrs values before release [skip ci]" dkist/data/api_search_values.json
- name: Install towncrier
run: python -m pip install --upgrade towncrier
run: python -m pip install --upgrade towncrier pre-commit

- name: Run towncrier in draft to capture the output
run: towncrier build --draft --version ${{ inputs.version }} --yes > release-changelog.rst

- name: Debug release-changelog.rst
run: cat release-changelog.rst

- name: Convert to markdown with pandoc
uses: docker://pandoc/core:2.9
with:
args: >- # allows you to break string into multiple lines
--wrap=none
-t markdown_strict
--output=release-changelog.md
release-changelog.rst
- name: Capture Markdown Changelog
id: markdown-changelog
run: |
Expand All @@ -77,6 +86,9 @@ jobs:
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Cleanup Markdown Changelog
run: rm release-changelog.md

- name: Debug md changelog
run: |
echo "${{ steps.markdown-changelog.outputs.content }}"
Expand All @@ -85,9 +97,15 @@ jobs:
run: |
towncrier build --version ${{ inputs.version }} ${{ inputs.tc_keep && '--yes' || '--keep' }}
- name: Run pre-commit
run: |
git add .
pre-commit run || true
git add .
- name: Commit Changelog
run: |
git commit -m "Render changelog for v${{ inputs.version }}" -a
git commit -m "Render changelog for v${{ inputs.version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
Expand All @@ -111,6 +129,6 @@ jobs:
repo: context.repo.repo,
tag_name: "${{ inputs.version }}",
name: "${{ inputs.version }}",
body: `${{ steps.markdown-changelog.outputs.content }}`
body: `${{ steps.markdown-changelog.outputs.content }}`,
draft: true
});

0 comments on commit 7343e99

Please sign in to comment.