Skip to content

Commit cd0f802

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

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

.github/changelog.entries

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
chore: test entry text 2
2-
chore: test entry text
1+
* chore: test entry text 2
2+
* chore: test entry text

.github/scripts/release.py

Lines changed: 21 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,22 @@ 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+
with open(f'{REPO_DIR}/.github/changelog.entries', 'r') as changelog:
121+
changes = changelog.read()
122+
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'r') as original:
123+
orig = original.read()
124+
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'w') as modified:
125+
modified.write(f'ruffle ({version}-{revision}) {suite}; urgency=medium\n\n{changes}\n\n -- {fullname} <{email}> {rfc2822date}\n\n{orig}')
126+
# Validate
127+
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'r') as original:
128+
orig = original.read()
129+
log(orig)
130+
131+
115132
# ===== Commands ===========================================
116133

117134
def bump():
@@ -129,7 +146,8 @@ def bump():
129146

130147
log(f'Next planned version is {next_planned_version}')
131148

132-
nightly_version = f'{next_planned_version}-nightly.{get_current_time_version()}'
149+
current_time_version = get_current_time_version()
150+
nightly_version = f'{next_planned_version}-nightly.{current_time_version}'
133151
log(f'Nightly version is {nightly_version}')
134152

135153
cargo_set_version([nightly_version])
@@ -146,6 +164,8 @@ def bump():
146164
github_output('version', version)
147165
github_output('version4', version4)
148166

167+
deb_changelog(next_planned_version, ''.join(part.zfill(2) for part in current_time_version.split('.')), datetime.now())
168+
149169

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

.github/workflows/release_nightly.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,44 @@ 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+
}
73+
- name: Get changelog
74+
uses: mikepenz/[email protected]
75+
with:
76+
owner: "ruffle-rs"
77+
repo: "ruffle"
78+
fromTag: "nightly-2025-12-01"
79+
toTag: "nightly-2025-12-02"
80+
token: ${{ secrets.PGITHUB_TOKEN }}
81+
outputFile: "./.github/changelog.entries.new"
82+
failOnError: "true"
83+
configurationJson: |
84+
{
85+
"template": "#{{UNCATEGORIZED}}",
86+
"pr_template": " * #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
87+
"categories": []
88+
}
5789
- name: Bump version
5890
if: steps.activity.outputs.is_active == 'true'
5991
id: version
6092
run: |
93+
cat .github/changelog.entries
94+
cat .github/changelog.entries.new
6195
$RELEASE_SCRIPT bump
6296
# Ensure newlines at the end of file
6397
shopt -s globstar

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ version:
5959
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
6060
sed $(SI) '1i\ -- $(DEBFULLNAME) <$(DEBEMAIL)> $(DEBDATE)' $(DEBIAN_DIR)/changelog; \
6161
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
62-
cat .github/changelog.entries | while read line; do \
63-
sed $(SI) "1i\ \ * $$line" $(DEBIAN_DIR)/changelog; \
62+
tac .github/changelog.entries | while read line; do \
63+
sed $(SI) "1i$$line" $(DEBIAN_DIR)/changelog; \
6464
done; \
6565
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
6666
sed $(SI) '1iruffle ($(VERSION)-$(REVISION)) $(DEBSUITE); urgency=medium' $(DEBIAN_DIR)/changelog; \

0 commit comments

Comments
 (0)