Skip to content

Commit d8565d5

Browse files
committed
ci: Add job for building debian packages
1 parent 94bdaa9 commit d8565d5

File tree

4 files changed

+142
-23
lines changed

4 files changed

+142
-23
lines changed

.github/scripts/release.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def bump():
134134
"""
135135

136136
current_version = cargo_get_version()
137+
current_day_id = get_current_day_id()
137138
log(f'Current version: {current_version}')
138139

139140
log('Bumping minor version to get the next planned version')
@@ -143,14 +144,13 @@ def bump():
143144

144145
log(f'Next planned version is {next_planned_version}')
145146

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

150150
cargo_set_version([nightly_version])
151151

152152
version = cargo_get_version()
153-
version4 = f'{next_planned_version}.{get_current_day_id()}'
153+
version4 = f'{next_planned_version}.{current_day_id}'
154154

155155
npm_dir = f'{REPO_DIR}/web'
156156
run_command(['npm', 'install', 'workspace-version'], cwd=npm_dir)
@@ -161,7 +161,7 @@ def bump():
161161
github_output('version', version)
162162
github_output('version4', version4)
163163

164-
deb_changelog(next_planned_version, ''.join(part.zfill(2) for part in current_time_version.split('.')), datetime.now())
164+
deb_changelog(version, current_day_id, datetime.now())
165165

166166

167167
def metainfo():

.github/workflows/release_nightly.yml

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

57+
- name: Get last tag
58+
id: last_tag
59+
run: echo "last_tag=`gh release list --order=desc --limit=1 --json tagName --jq '.[0].tagName'`" >> $GITHUB_OUTPUT
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.PGITHUB_TOKEN }}
5762
- name: Get changelog
5863
uses: mikepenz/[email protected]
5964
with:
60-
owner: "ruffle-rs"
61-
repo: "ruffle"
62-
fromTag: "nightly-2025-12-01"
63-
toTag: "nightly-2025-12-02"
65+
owner: ruffle-rs
66+
repo: ruffle
67+
#fromTag: nightly-2025-12-03
68+
fromTag: ${{ steps.last_tag.outputs.last_tag }}
69+
toTag: HEAD
6470
token: ${{ secrets.PGITHUB_TOKEN }}
65-
outputFile: ".github/changelog.entries"
66-
failOnError: "true"
71+
outputFile: .github/changelog.entries
6772
configurationJson: |
6873
{
6974
"template": "#{{UNCATEGORIZED}}",
@@ -663,3 +668,121 @@ jobs:
663668
commit_email: [email protected]
664669
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
665670
commit_message: Update to ${{ needs.create-nightly-release.outputs.tag_name }}
671+
672+
build-debian-packages:
673+
name: Build Debian ${{ matrix.build_name }} packages
674+
needs: [create-nightly-release, build]
675+
strategy:
676+
fail-fast: false
677+
matrix:
678+
include:
679+
- build_name: amd64
680+
os: ubuntu-24.04
681+
arch: x86_64
682+
- build_name: arm64
683+
os: ubuntu-24.04-arm
684+
arch: aarch64
685+
runs-on: ${{ matrix.os }}
686+
if: github.repository == 'donmor/ruffle'
687+
steps:
688+
- uses: actions/checkout@v6
689+
with:
690+
ref: ${{ needs.create-nightly-release.outputs.tag_name }}
691+
- name: Get current time with dashes
692+
uses: josStorer/[email protected]
693+
id: current_time_dashes
694+
with:
695+
format: YYYY-MM-DD
696+
697+
- name: Get current time with dots
698+
uses: josStorer/[email protected]
699+
id: current_time_dots
700+
with:
701+
format: YYYY.M.D
702+
703+
- name: Install build dependencies
704+
run: sudo apt install debhelper rename
705+
- name: Prepare informations and source
706+
id: profiling
707+
run: |
708+
version4=${{ needs.create-nightly-release.outputs.version4 }}
709+
version=${{ needs.create-nightly-release.outputs.version }}
710+
revision=${version4##*.}
711+
echo "version=${version}" >>$GITHUB_OUTPUT
712+
echo "revision=${revision}" >>$GITHUB_OUTPUT
713+
git archive --prefix=ruffle-${version}/ -o ../ruffle_${version}.orig.tar.gz HEAD
714+
cp -a desktop/packages/linux/debian ./
715+
- name: Build Source package
716+
if: runner.arch == 'X64'
717+
run: |
718+
dpkg-buildpackage -us -uc -d -S
719+
- name: Get prebuilt binaries
720+
run: |
721+
gh release download "${{ needs.create-nightly-release.outputs.tag_name }}" --pattern "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz"
722+
tar -xf "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz" ruffle
723+
rm "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz"
724+
mv ruffle ruffle_desktop
725+
env:
726+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
727+
- name: Build Packages
728+
run: |
729+
dpkg-buildpackage -us -uc -nc -d -b
730+
rename 's/\.deb/\.ddeb/' *-dbgsym*.deb
731+
- name: Move built files (sources)
732+
if: runner.arch == 'X64'
733+
run: |
734+
mv ../ruffle_${{ steps.profiling.outputs.version }}.orig.tar.gz ./
735+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.debian.tar.xz ./
736+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.dsc ./
737+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.buildinfo ./
738+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.changes ./
739+
- name: Move built files (packages)
740+
run: |
741+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.buildinfo ./
742+
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.changes ./
743+
mv ../ruffle-desktop_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.deb ./
744+
mv ../ruffle-desktop-dbgsym_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.ddeb ./
745+
- name: Upload Source package as build artifact
746+
if: runner.arch == 'X64'
747+
uses: actions/upload-artifact@v5
748+
with:
749+
name: deb-source
750+
path: |
751+
ruffle_${{ steps.profiling.outputs.version }}.orig.tar.gz
752+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.debian.tar.xz
753+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.dsc
754+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.buildinfo
755+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.changes
756+
- name: Upload Packages as build artifact
757+
uses: actions/upload-artifact@v5
758+
with:
759+
name: deb-${{ matrix.build_name }}
760+
path: |
761+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.buildinfo
762+
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.changes
763+
ruffle-desktop_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.deb
764+
ruffle-desktop-dbgsym_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.ddeb
765+
publish-debian-packages:
766+
name: Publish Debian packages
767+
needs: [create-nightly-release, build-debian-packages]
768+
runs-on: ubuntu-24.04
769+
steps:
770+
- name: Download all artifacts previously built
771+
uses: actions/download-artifact@v4
772+
with:
773+
merge-multiple: true
774+
run-id: ${{ needs.build-debian-packages.outputs.run_id }}
775+
path: download/${{ needs.create-nightly-release.outputs.tag_name }}
776+
- name: Generate trivial source
777+
working-directory: download/${{ needs.create-nightly-release.outputs.tag_name }}
778+
run: |
779+
dpkg-scanpackages -m ../../download/${{ needs.create-nightly-release.outputs.tag_name }} > Packages
780+
dpkg-scanpackages -t ddeb -m ../../download/${{ needs.create-nightly-release.outputs.tag_name }} >> Packages
781+
dpkg-scansources ../../download/${{ needs.create-nightly-release.outputs.tag_name }} > Sources
782+
apt-ftparchive release . > Release
783+
- name: Upload packages
784+
run: |
785+
gh release upload -R ${{ github.repository }} "${{ needs.create-nightly-release.outputs.tag_name }}" `find download -name 'ruffle*.deb'` `find download -name 'ruffle*.ddeb'`
786+
gh release upload -R ${{ github.repository }} "${{ needs.create-nightly-release.outputs.tag_name }}" `find download -name 'ruffle*.orig.tar.gz'` `find download -name 'ruffle*.debian.tar.xz'` `find download -name 'ruffle*.dsc'` download/${{ needs.create-nightly-release.outputs.tag_name }}/Packages download/${{ needs.create-nightly-release.outputs.tag_name }}/Sources download/${{ needs.create-nightly-release.outputs.tag_name }}/Release
787+
env:
788+
GITHUB_TOKEN: ${{ secrets.PGITHUB_TOKEN }}

Makefile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ prefix ?= /usr/local
1616
VERSION := $(shell cargo metadata --format-version=1 --no-deps --offline | jq -r '.packages[] | select(.name == "ruffle_desktop").version')
1717
DEBIAN_ORIG_GZ := ../ruffle_$(VERSION).orig.tar.gz
1818
DEBIAN_ORIG_XZ := ../ruffle_$(VERSION).orig.tar.xz
19-
REVISION := $(shell echo $(notdir $(CURDIR)) | sed 's/$(VERSION)//' | tr -cd '0-9')
19+
REVISION := $(shell date -d $(shell echo $(notdir $(CURDIR)) | sed 's/ruffle-//' | sed 's/nightly-//' | sed 's/$(VERSION)-//') +%y%j)
2020
ifeq ($(REVISION),)
21-
REVISION := $(shell date +%Y%m%d)
21+
REVISION := $(shell date +%y%j)
2222
endif
2323

2424
all: ruffle_desktop
@@ -63,7 +63,7 @@ version:
6363
fi; \
6464
sed $(SI) '1i\ -- $(DEBFULLNAME) <$(DEBEMAIL)> $(DEBDATE)' $(DEBIAN_DIR)/changelog; \
6565
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
66-
touch -a .github/changelog.entries \
66+
touch -a .github/changelog.entries; \
6767
tac .github/changelog.entries | while read line; do \
6868
sed $(SI) "1i$$line" $(DEBIAN_DIR)/changelog; \
6969
done; \
@@ -73,8 +73,12 @@ version:
7373

7474
deb: version
7575
@if [ ! -s $(DEBIAN_ORIG_XZ) -a ! -s $(DEBIAN_ORIG_GZ) ]; then \
76-
echo 'Creating $(DEBIAN_ORIG_GZ) from HEAD...' >&2; \
77-
git archive --prefix=ruffle-$(VERSION)/ -o $(DEBIAN_ORIG_GZ) HEAD; \
76+
if [ -s ../$(notdir $(CURDIR)).tar.gz ]; then \
77+
mv -v ../$(notdir $(CURDIR)).tar.gz $(DEBIAN_ORIG_GZ); \
78+
else \
79+
echo 'Creating $(DEBIAN_ORIG_GZ) from HEAD...' >&2; \
80+
git archive --prefix=ruffle-$(VERSION)/ -o $(DEBIAN_ORIG_GZ) HEAD; \
81+
fi; \
7882
fi
7983
rm -rf debian
8084
cp -a $(DEBIAN_DIR) ./
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
ruffle (0.1.0-20251202) unstable; urgency=medium
2-
3-
* chore: test entry text
4-
* chore: test entry text 2
5-
6-
-- unknown <unknown@localhost> Tue, 02 Dec 2025 20:57:04 +0800
7-
8-
91

0 commit comments

Comments
 (0)