Compare commits
2 Commits
6b8fe820aa
...
23613d16b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 23613d16b7 | |||
| 8cd1d56b4a |
@@ -45,7 +45,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "changelog=$(cat $CHANGELOG_FILE)" >> $GITHUB_OUTPUT
|
||||
echo "changelog_file=$CHANGELOG_FILE" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build Artifacts
|
||||
if: steps.tag.outputs.version
|
||||
@@ -59,18 +59,17 @@ jobs:
|
||||
id: create_release
|
||||
run: |
|
||||
VERSION="${{ steps.tag.outputs.version }}"
|
||||
CHANGELOG="${{ steps.changelog.outputs.changelog }}"
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
CHANGELOG_FILE="${{ steps.changelog.outputs.changelog_file }}"
|
||||
RESPONSE=$(jq -n \
|
||||
--arg tag "v$VERSION" \
|
||||
--arg name "wapp-v$VERSION" \
|
||||
--rawfile body "$CHANGELOG_FILE" \
|
||||
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}' \
|
||||
| curl -s -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases" \
|
||||
-d '{
|
||||
"tag_name": "v'"$VERSION"'",
|
||||
"name": "wapp-v'"$VERSION"'",
|
||||
"body": "'"$CHANGELOG"'",
|
||||
"draft": false,
|
||||
"prerelease": false
|
||||
}')
|
||||
--data-binary @- \
|
||||
"https://git.thewizardapprentice.com/api/v1/repos/${{ gitea.repository }}/releases")
|
||||
|
||||
echo "$RESPONSE"
|
||||
RELEASE_ID=$(echo $RESPONSE | jq -r '.id')
|
||||
|
||||
@@ -2,9 +2,9 @@ import os
|
||||
import re
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
from tempfile import mkstemp
|
||||
|
||||
VERSION_HEADER = re.compile(r"\[\d+.\d+.\d+\]")
|
||||
SCRIPT_DIR = Path(__file__).absolute().parent.parent
|
||||
|
||||
|
||||
def main():
|
||||
@@ -19,8 +19,7 @@ def main():
|
||||
|
||||
|
||||
def get_changelog(version: str) -> list[str]:
|
||||
script_dir = Path(__file__).absolute().parent.parent
|
||||
changelog = script_dir / "CHANGELOG.md"
|
||||
changelog = SCRIPT_DIR / "CHANGELOG.md"
|
||||
|
||||
with changelog.open("r") as infile:
|
||||
lines = infile.readlines()
|
||||
@@ -47,10 +46,10 @@ def get_changelog(version: str) -> list[str]:
|
||||
|
||||
|
||||
def save_changelog(version: str, lines: list[str]) -> str:
|
||||
fd, name = mkstemp(prefix=f"wapp-changelog-{version}-", text=True)
|
||||
os.write(fd, "".join(lines).encode("utf-8"))
|
||||
os.close(fd)
|
||||
return name
|
||||
version_changelog = SCRIPT_DIR / f"wapp-changelog-{version}.md"
|
||||
with version_changelog.open("w") as outfile:
|
||||
outfile.writelines(lines)
|
||||
return str(version_changelog)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user