Skip to content

Commit 94bdaa9

Browse files
committed
ci: Add changelog creation before nightly release
1 parent 55a202f commit 94bdaa9

File tree

5 files changed

+45
-6
lines changed

5 files changed

+45
-6
lines changed

.github/changelog.entries

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/scripts/release.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import subprocess
55
import sys
66
from datetime import datetime
7+
from email import utils
78
import xml.etree.ElementTree as xml
89
import json
910

@@ -112,6 +113,19 @@ def gh_get_last_nightly_tag():
112113
return next(gh_list_nightly_tags(16), None)
113114

114115

116+
def deb_changelog(version, revision, date, fullname='ruffle', email='[email protected]', suite='unstable'):
117+
orig = ''
118+
changes = ''
119+
rfc2822date = utils.format_datetime(date)
120+
if os.path.exists(f'{REPO_DIR}/.github/changelog.entries'):
121+
with open(f'{REPO_DIR}/.github/changelog.entries', 'r') as changelog:
122+
changes = changelog.read()
123+
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'r') as original:
124+
orig = original.read()
125+
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'w') as modified:
126+
modified.write(f'ruffle ({version}-{revision}) {suite}; urgency=medium\n\n{changes}\n\n -- {fullname} <{email}> {rfc2822date}\n\n{orig}')
127+
128+
115129
# ===== Commands ===========================================
116130

117131
def bump():
@@ -129,7 +143,8 @@ def bump():
129143

130144
log(f'Next planned version is {next_planned_version}')
131145

132-
nightly_version = f'{next_planned_version}-nightly.{get_current_time_version()}'
146+
current_time_version = get_current_time_version()
147+
nightly_version = f'{next_planned_version}-nightly.{current_time_version}'
133148
log(f'Nightly version is {nightly_version}')
134149

135150
cargo_set_version([nightly_version])
@@ -146,6 +161,8 @@ def bump():
146161
github_output('version', version)
147162
github_output('version4', version4)
148163

164+
deb_changelog(next_planned_version, ''.join(part.zfill(2) for part in current_time_version.split('.')), datetime.now())
165+
149166

150167
def metainfo():
151168
metainfo_path1 = f'{REPO_DIR}/desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml'

.github/workflows/release_nightly.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,22 @@ jobs:
5454
crate: cargo-get
5555
version: '^1.0'
5656

57+
- name: Get changelog
58+
uses: mikepenz/[email protected]
59+
with:
60+
owner: "ruffle-rs"
61+
repo: "ruffle"
62+
fromTag: "nightly-2025-12-01"
63+
toTag: "nightly-2025-12-02"
64+
token: ${{ secrets.PGITHUB_TOKEN }}
65+
outputFile: ".github/changelog.entries"
66+
failOnError: "true"
67+
configurationJson: |
68+
{
69+
"template": "#{{UNCATEGORIZED}}",
70+
"pr_template": " * #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
71+
"categories": []
72+
}
5773
- name: Bump version
5874
if: steps.activity.outputs.is_active == 'true'
5975
id: version

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ RECOVER_*.fla
2020
# Generated by Make
2121
ruffle_desktop
2222
/debian
23+
24+
# CI middle files
25+
/.github/changelog.entries

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ uninstall:
5656
version:
5757
@echo $(VERSION)-$(REVISION)
5858
@-if ! grep "$(VERSION)-$(REVISION)" $(DEBIAN_DIR)/changelog; then \
59-
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
59+
if [ -s $(DEBIAN_DIR)/changelog ]; then \
60+
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
61+
else \
62+
echo > $(DEBIAN_DIR)/changelog; \
63+
fi; \
6064
sed $(SI) '1i\ -- $(DEBFULLNAME) <$(DEBEMAIL)> $(DEBDATE)' $(DEBIAN_DIR)/changelog; \
6165
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
62-
cat .github/changelog.entries | while read line; do \
63-
sed $(SI) "1i\ \ * $$line" $(DEBIAN_DIR)/changelog; \
66+
touch -a .github/changelog.entries \
67+
tac .github/changelog.entries | while read line; do \
68+
sed $(SI) "1i$$line" $(DEBIAN_DIR)/changelog; \
6469
done; \
6570
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
6671
sed $(SI) '1iruffle ($(VERSION)-$(REVISION)) $(DEBSUITE); urgency=medium' $(DEBIAN_DIR)/changelog; \

0 commit comments

Comments
 (0)