Refactor release script to be more modular

This commit is contained in:
Willy-JL
2023-03-29 14:04:43 +01:00
parent 6e903cd40c
commit f6679cc8d8
6 changed files with 75 additions and 27 deletions

19
.github/workflow_data/release.py vendored Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env python
import json
import os
if __name__ == "__main__":
notes_path = '.github/workflow_data/release.md'
with open(os.environ['GITHUB_EVENT_PATH']) as f:
changelog = json.load(f.read())['pull_request']['body']
with open(notes_path, "r") as f:
template = f.read()
notes = template.format(
ARTIFACT_TGZ=os.environ['ARTIFACT_TGZ'],
ARTIFACT_WEB=os.environ['ARTIFACT_WEB'],
ARTIFACT_ZIP=os.environ['ARTIFACT_ZIP'],
VERSION_TAG=os.environ['VERSION_TAG'],
CHANGELOG=changelog
)
with open(notes_path, "w") as f:
f.write(notes)