Skip to content

Commit

Permalink
fix: import yaml & refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Jan 12, 2024
1 parent a0988e7 commit 68f713c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
if not (greater == 1 and equal == 2):
raise ValueError(f"Next version must only increment one number at a time. Current version: {current_version}. Proposed next version: {next_version}")
- name: Get release notes & update changelog
- name: Get release notes, update changelog & version file
shell: python {0}
run: |
import os
Expand All @@ -96,24 +96,25 @@ jobs:
next_release_lines.append(line)
with open(".github/latest-release.md", "w") as outfile:
outfile.write(''.join(next_release_lines))
outfile.writelines(next_release_lines)
with open('CHANGELOG.md', 'w') as outfile:
outfile.write(''.join(changelog_lines))
outfile.writelines(changelog_lines)
with open("VERSION", "w") as outfile:
outfile.write(f"{next_version}\n")
- name: Update citation & version files
- name: Update citation
shell: python {0}
run: |
from cffconvert.cli.create_citation import create_citation
from cffconvert.cli.validate_or_write_output import validate_or_write_output
import yaml
citation = create_citation('CITATION.cff', None)
citation._implementation.cffobj['version'] = "${{ env.NEXT_VERSION }}"
citation._implementation.cffobj['date-released'] = "${{ env.DATE }}"
with open('CITATION.cff', 'w') as outfile:
outfile.write(yaml.dump(citation._implementation.cffobj, sort_keys=False))
with open("VERSION", "w") as outfile:
outfile.write("${{ env.NEXT_STRICT }}")
- name: Commit & push to branch
run: |
git config --local user.name "github-actions[bot]"
Expand Down

0 comments on commit 68f713c

Please sign in to comment.