Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import subprocess
import sys
from datetime import datetime
from email import utils
import xml.etree.ElementTree as xml
import json

Expand Down Expand Up @@ -112,6 +113,19 @@ def gh_get_last_nightly_tag():
return next(gh_list_nightly_tags(16), None)


def deb_changelog(version, revision, date, fullname='ruffle', email='[email protected]', suite='unstable'):
orig = ''
changes = ''
rfc2822date = utils.format_datetime(date)
if os.path.exists(f'{REPO_DIR}/.github/changelog.entries'):
with open(f'{REPO_DIR}/.github/changelog.entries', 'r') as changelog:
changes = changelog.read()
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'r') as original:
orig = original.read()
with open(f'{REPO_DIR}/desktop/packages/linux/debian/changelog', 'w') as modified:
modified.write(f'ruffle ({version}-{revision}) {suite}; urgency=medium\n\n{changes}\n\n -- {fullname} <{email}> {rfc2822date}\n\n{orig}')


# ===== Commands ===========================================

def bump():
Expand All @@ -120,6 +134,7 @@ def bump():
"""

current_version = cargo_get_version()
current_day_id = get_current_day_id()
log(f'Current version: {current_version}')

log('Bumping minor version to get the next planned version')
Expand All @@ -135,7 +150,7 @@ def bump():
cargo_set_version([nightly_version])

version = cargo_get_version()
version4 = f'{next_planned_version}.{get_current_day_id()}'
version4 = f'{next_planned_version}.{current_day_id}'

npm_dir = f'{REPO_DIR}/web'
run_command(['npm', 'install', 'workspace-version'], cwd=npm_dir)
Expand All @@ -146,6 +161,8 @@ def bump():
github_output('version', version)
github_output('version4', version4)

deb_changelog(version, current_day_id, datetime.now())


def metainfo():
metainfo_path1 = f'{REPO_DIR}/desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml'
Expand Down
155 changes: 155 additions & 0 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
package_prefix: ${{ steps.create_release.outputs.package_prefix }}
tag_name: ${{ steps.commit.outputs.tag_name }}
version: ${{ steps.version.outputs.version }}
version4: ${{ steps.version.outputs.version4 }}

# Only run the scheduled workflows on the main repo.
Expand Down Expand Up @@ -54,6 +55,27 @@ jobs:
crate: cargo-get
version: '^1.0'

- name: Get last tag
id: last_tag
run: echo "last_tag=`gh release list --order=desc --limit=1 --json tagName --jq '.[0].tagName'`" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.PGITHUB_TOKEN }}
- name: Get changelog
uses: mikepenz/[email protected]
with:
owner: ruffle-rs
repo: ruffle
#fromTag: nightly-2025-12-03
fromTag: ${{ steps.last_tag.outputs.last_tag }}
toTag: HEAD
token: ${{ secrets.PGITHUB_TOKEN }}
outputFile: .github/changelog.entries
configurationJson: |
{
"template": "#{{UNCATEGORIZED}}",
"pr_template": " * #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}",
"categories": []
}
- name: Bump version
if: steps.activity.outputs.is_active == 'true'
id: version
Expand Down Expand Up @@ -647,3 +669,136 @@ jobs:
commit_email: [email protected]
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update to ${{ needs.create-nightly-release.outputs.tag_name }}

build-debian-packages:
name: Build Debian ${{ matrix.build_name }} packages
needs: [create-nightly-release, build]
strategy:
fail-fast: false
matrix:
include:
- build_name: amd64
os: ubuntu-24.04
arch: x86_64
- build_name: arm64
os: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.os }}
if: github.repository == 'donmor/ruffle'
steps:
- uses: actions/checkout@v6
with:
ref: ${{ needs.create-nightly-release.outputs.tag_name }}
- name: Get current time with dashes
uses: josStorer/[email protected]
id: current_time_dashes
with:
format: YYYY-MM-DD

- name: Get current time with dots
uses: josStorer/[email protected]
id: current_time_dots
with:
format: YYYY.M.D

- name: Install build dependencies
run: sudo apt install debhelper rename
- name: Prepare informations and source
id: profiling
run: |
version4=${{ needs.create-nightly-release.outputs.version4 }}
version=${{ needs.create-nightly-release.outputs.version }}
revision=${version4##*.}
echo "version=${version}" >>$GITHUB_OUTPUT
echo "revision=${revision}" >>$GITHUB_OUTPUT
git archive --prefix=ruffle-${version}/ -o ../ruffle_${version}.orig.tar.gz HEAD
cp -a desktop/packages/linux/debian ./
- name: Build Source package
if: runner.arch == 'X64'
run: |
dpkg-buildpackage -us -uc -d -S
- name: Get prebuilt binaries
run: |
gh release download "${{ needs.create-nightly-release.outputs.tag_name }}" --pattern "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz"
gh release download "${{ needs.create-nightly-release.outputs.tag_name }}" --pattern "${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension.zip"
gh release download "${{ needs.create-nightly-release.outputs.tag_name }}" --pattern "${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension-firefox-unsigned.xpi"
tar -xf "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz" ruffle
rm "${{ needs.create-nightly-release.outputs.package_prefix }}-linux-${{ matrix.arch }}.tar.gz"
mkdir -p web/packages/extension/dist
mv "${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension.zip" web/packages/extension/dist/ruffle_extension.zip
mv "${{ needs.create-nightly-release.outputs.package_prefix }}-web-extension-firefox-unsigned.xpi" web/packages/extension/dist/firefox_unsigned.xpi
mkdir -p target/release
mv ruffle target/release/ruffle_desktop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Packages
run: |
dpkg-buildpackage -us -uc -nc -d -b
rename 's/\.deb/\.ddeb/' *-dbgsym*.deb
- name: Move built files (sources)
if: runner.arch == 'X64'
run: |
mv ../ruffle_${{ steps.profiling.outputs.version }}.orig.tar.gz ./
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.debian.tar.xz ./
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.dsc ./
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.buildinfo ./
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.changes ./
- name: Move built files (packages)
run: |
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.buildinfo ./
mv ../ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.changes ./
mv ../ruffle-desktop_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.deb ./
mv ../ruffle-desktop-dbgsym_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.ddeb ./
mv ../webext-ruffle-flash-emulator_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_all.deb ./
- name: Upload Source package as build artifact
if: runner.arch == 'X64'
uses: actions/upload-artifact@v5
with:
name: deb-source
path: |
ruffle_${{ steps.profiling.outputs.version }}.orig.tar.gz
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.debian.tar.xz
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}.dsc
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.buildinfo
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_source.changes
- name: Upload Extension Package as build artifact
if: runner.arch == 'X64'
uses: actions/upload-artifact@v5
with:
name: deb-all
path: |
webext-ruffle-flash-emulator_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_all.deb
- name: Upload Packages as build artifact
uses: actions/upload-artifact@v5
with:
name: deb-${{ matrix.build_name }}
path: |
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.buildinfo
ruffle_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.changes
ruffle-desktop_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.deb
ruffle-desktop-dbgsym_${{ steps.profiling.outputs.version }}-${{ steps.profiling.outputs.revision }}_${{ matrix.build_name }}.ddeb
publish-debian-packages:
name: Publish Debian packages
needs: [create-nightly-release, build-debian-packages]
runs-on: ubuntu-24.04
steps:
- name: Download all artifacts previously built
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: deb-*
run-id: ${{ needs.build-debian-packages.outputs.run_id }}
path: download/${{ needs.create-nightly-release.outputs.tag_name }}
- name: Generate trivial source
working-directory: download/${{ needs.create-nightly-release.outputs.tag_name }}
run: |
dpkg-scanpackages -m ../../download/${{ needs.create-nightly-release.outputs.tag_name }} > Packages
dpkg-scanpackages -t ddeb -m ../../download/${{ needs.create-nightly-release.outputs.tag_name }} >> Packages
dpkg-scansources ../../download/${{ needs.create-nightly-release.outputs.tag_name }} > Sources
apt-ftparchive release . > Release
- name: Upload packages
run: |
gh release upload -R ${{ github.repository }} "${{ needs.create-nightly-release.outputs.tag_name }}" `find download -name '*ruffle*.deb'` `find download -name 'ruffle*.ddeb'`
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
env:
GITHUB_TOKEN: ${{ secrets.PGITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ RECOVER_*.fla

# Mac junk
.DS_Store

# Generated by Make
/debian

# CI middle files
/.github/changelog.entries
110 changes: 110 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.PHONY: all clean distclean ruffle_desktop ruffle_webext install uninstall version deb

SI := -i ''
ifeq ($(shell sed --version 2>/dev/null | head -1 | grep -q GNU && echo GNU),GNU)
SI := -i
endif

DEBIAN_DIR := desktop/packages/linux/debian
DEBFULLNAME ?= unknown
DEBEMAIL ?= unknown@localhost
DEBDATE ?= $(shell date -R)
DEBSUITE ?= unstable

prefix ?= /usr/local

VERSION := $(shell cargo metadata --format-version=1 --no-deps --offline | jq -r '.packages[] | select(.name == "ruffle_desktop").version')
DEBIAN_ORIG_GZ := ../ruffle_$(VERSION).orig.tar.gz
DEBIAN_ORIG_XZ := ../ruffle_$(VERSION).orig.tar.xz
REVISION := $(shell date -d $(shell echo $(notdir $(CURDIR)) | sed 's/ruffle-//' | sed 's/nightly-//' | sed 's/$(VERSION)-//') +%y%j 2>/dev/null)
ifeq ($(REVISION),)
REVISION := $(shell date +%y%j)
endif

all: target/release/ruffle_desktop web/packages/extension/dist/ruffle_extension.zip web/packages/extension/dist/firefox_unsigned.xpi

clean:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it also clean the ignored files in /debian?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add this later

-rm -f ruffle_desktop
-rm -rf target

distclean: clean
-find . -name "*.o" -delete
-rm -rf *.swd RECOVER_*.fla /.idea .DS_Store
-cd $(DEBIAN_DIR) && rm -rf ./ruffle.substvars ./.debhelper/ ./debhelper-build-stamp ./files ./ruffle/ ./ruffle.debhelper.log ./tmp/

ruffle_desktop: target/release/ruffle_desktop

target/release/ruffle_desktop:
cargo build --release --package=ruffle_desktop

ruffle_webext: web/packages/extension/dist/ruffle_extension.zip web/packages/extension/dist/firefox_unsigned.xpi

web/packages/extension/dist/ruffle_extension.zip web/packages/extension/dist/firefox_unsigned.xpi:
cd web && npm install
cd web && CARGO_FEATURES=jpegxr WASM_SOURCE=cargo_and_store npm run build:dual-wasm-repro

install: target/release/ruffle_desktop web/packages/extension/dist/ruffle_extension.zip web/packages/extension/dist/firefox_unsigned.xpi
install -d $(DESTDIR)$(prefix)/bin/
install -m755 target/release/ruffle_desktop $(DESTDIR)$(prefix)/bin/
install -d $(DESTDIR)$(prefix)/share/
install -d $(DESTDIR)$(prefix)/share/applications/
install -m644 desktop/packages/linux/rs.ruffle.Ruffle.desktop $(DESTDIR)$(prefix)/share/applications/
install -d $(DESTDIR)$(prefix)/share/metainfo/
install -m644 desktop/packages/linux/rs.ruffle.Ruffle.metainfo.xml $(DESTDIR)$(prefix)/share/metainfo/
install -d $(DESTDIR)$(prefix)/share/icons/
install -d $(DESTDIR)$(prefix)/share/icons/hicolor/
install -d $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/
install -d $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/
install -m644 desktop/packages/linux/rs.ruffle.Ruffle.svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/
install -d $(DESTDIR)$(prefix)/share/webext/
install -d $(DESTDIR)$(prefix)/share/webext/ruffle-flash-emulator/
install -d $(DESTDIR)$(prefix)/share/chromium/
install -d $(DESTDIR)$(prefix)/share/chromium/extensions/
install -d $(DESTDIR)$(prefix)/share/mozilla/
install -d $(DESTDIR)$(prefix)/share/mozilla/extensions/
install -d $(DESTDIR)$(prefix)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/
unzip -o web/packages/extension/dist/ruffle_extension.zip -d $(DESTDIR)$(prefix)/share/webext/ruffle-flash-emulator/
ln -sf /usr/share/webext/ruffle-flash-emulator $(DESTDIR)$(prefix)/share/chromium/extensions/
install -m644 web/packages/extension/dist/firefox_unsigned.xpi $(DESTDIR)$(prefix)/share/webext/[email protected]
ln -sf /usr/share/webext/[email protected] $(DESTDIR)$(prefix)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/

uninstall:
-rm -f $(DESTDIR)$(prefix)/bin/ruffle_desktop
-rm -f $(DESTDIR)$(prefix)/share/applications/rs.ruffle.Ruffle.desktop
-rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/rs.ruffle.Ruffle.svg
-rm -f $(DESTDIR)$(prefix)/share/metainfo/rs.ruffle.Ruffle.metainfo.xml
-rm -f $(DESTDIR)$(prefix)/share/chromium/extensions/ruffle-flash-emulator
-rm -f $(DESTDIR)$(prefix)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
-rm -rf $(DESTDIR)$(prefix)/share/webext/ruffle-flash-emulator
-rm -f $(DESTDIR)$(prefix)/share/webext/[email protected]

version:
@echo $(VERSION)-$(REVISION)
@-if ! grep "$(VERSION)-$(REVISION)" $(DEBIAN_DIR)/changelog; then \
if [ -s $(DEBIAN_DIR)/changelog ]; then \
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
else \
echo > $(DEBIAN_DIR)/changelog; \
fi; \
sed $(SI) '1i\ -- $(DEBFULLNAME) <$(DEBEMAIL)> $(DEBDATE)' $(DEBIAN_DIR)/changelog; \
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
touch -a .github/changelog.entries; \
tac .github/changelog.entries | while read line; do \
sed $(SI) "1i$$line" $(DEBIAN_DIR)/changelog; \
done; \
sed $(SI) '1i\\' $(DEBIAN_DIR)/changelog; \
sed $(SI) '1iruffle ($(VERSION)-$(REVISION)) $(DEBSUITE); urgency=medium' $(DEBIAN_DIR)/changelog; \
fi

deb: version
@if [ ! -s $(DEBIAN_ORIG_XZ) -a ! -s $(DEBIAN_ORIG_GZ) ]; then \
if [ -s ../$(notdir $(CURDIR)).tar.gz ]; then \
mv -v ../$(notdir $(CURDIR)).tar.gz $(DEBIAN_ORIG_GZ); \
else \
echo 'Creating $(DEBIAN_ORIG_GZ) from HEAD...' >&2; \
git archive --prefix=ruffle-$(VERSION)/ -o $(DEBIAN_ORIG_GZ) HEAD; \
fi; \
fi
rm -rf debian
cp -a $(DEBIAN_DIR) ./
dpkg-buildpackage -us -uc
7 changes: 7 additions & 0 deletions desktop/packages/linux/debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*.substvars
/.debhelper/
/debhelper-build-stamp
/files
/ruffle/
/ruffle.debhelper.log
/tmp/
Empty file.
36 changes: 36 additions & 0 deletions desktop/packages/linux/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Source: ruffle
Section: misc
Priority: optional
Maintainer: unknown <localhost>
Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
rustc (>= 1.86),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will definitely desync. Maybe setting up a CI would somehow address it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some dependencies may require a random rust toolchain version (rather than 1.85 for edition2024, etc.), I changed it to 1.86 because it complains about it. There may be a way to detect the minimum required toolchain version (hoping it won't be newer than that in sid...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, Ruffle waits several days after a new Rust version is released and then starts using it. So we generally keep up with repos such as Fedora, Arch, but I'm not sure how this works in sid.

Based on my previous interest in packaging Ruffle, we are just incompatible with most distributions, and packaging Ruffle doesn't make sense, because you would be using versions from several months ago, because dependencies cannot keep up. The only two distributions where packaging Ruffle would be doable was Fedora and Arch.

From what I see, there's rustc 1.90.0 on sid, which means the newest Ruffle version working there would be ~1 month old as of today. I think this is acceptable, but looking at the latest stable, it would be ~8 months, for the oldest stable it would be ~5 years. IMO this is unacceptable considering the current development model of Ruffle, as it would produce packages which are basically unsupported at launch. Not to mention we don't have a way of backporting bugfixes, because we don't have stable releases.

But that's also the reason we have the Flatpak app, it should work on every distro and we don't have to worry about dependencies too much.

cargo (>= 1.86),
libasound2-dev,
libudev-dev,
jq,
nodejs,
librust-wasm-bindgen-dev,
default-jdk-headless,
binaryen,
libjxr-dev,
Standards-Version: 4.7.2
Homepage: https://ruffle.rs/
#Vcs-Browser: https://github.com/ruffle-rs/ruffle
#Vcs-Git: https://github.com/ruffle-rs/ruffle.git

Package: ruffle-desktop
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends},
Description: A Flash Player emulator written in Rust
Ruffle is an Adobe Flash Player emulator written in the Rust programming
language. Ruffle targets both the desktop and the web using WebAssembly.

Package: webext-ruffle-flash-emulator
Architecture: all
Description: A Flash Player emulator written in Rust (web extensions)
Ruffle is an Adobe Flash Player emulator written in the Rust programming
language. Ruffle targets both the desktop and the web using WebAssembly.
Loading
Loading